This document provides an overview of the Three.js library for creating 3D graphics in web browsers using WebGL. It discusses key Three.js concepts like scenes, cameras, lights, materials, and textures. It also provides examples of how to load 3D models and textures, set up animations, and add interactivity using controls. Useful links are included for learning more about Three.js and WebGL fundamentals.
53. 53
Request a browser to repeat
animate()
Draw model
Update camera position
requestAnimationFrame
animate: function() {
requestAnimationFrame(Player.animate);
Player.controls.update();
Player.renderer.render(Player.scene, Player.camera);
}
Animation loop
58. 58
geometry = new THREE.SphereGeometry(100, 50, 50);
material = new THREE.MeshPhongMaterial({map: texture});
Player.mesh = new THREE.Mesh(geometry, material);
Player.scene.add(Player.mesh);
Sphere
65. 65
Where can I use it?
• Raster graphics rendering
• Image editing and analysis
• Filtering video
• Interactive graphics
• Games
• Statistics in the form of graphs
68. 68
Useful links
WebGL Fundamentals
WebGL Academy
Learning Three.js: The JavaScript 3D Library for WebGL
Mozilla
Three.js Books
learningwebgl.com
davidscottlyons.com/threejs