Book description
Create stunning 3D graphics in your browser using the Three.js JavaScript library
In Detail
Modern browsers support WebGL, which makes it possible to create 3D graphics in a browser without having to use plugins such as Flash and Java. Programming WebGL, however, is difficult, complex, and very difficult to debug. With Three.js, it is possible to create stunning 3D graphics in an intuitive manner using JavaScript, without the need to know the details of WebGL.
Learning Three.js - the JavaScript 3D Library for WebGL, Second Edition, is a practical, example-rich book that will help you learn about all the features of Three.js. This book will show you how to create or load models from externally created models and realistic-looking 3D objects using materials and textures. You'll also learn how to use the HTML5 video and canvas elements as a material for your 3D objects, different ways of animating your models, skeleton-based animation, and how to add physics such as gravity and collision detection to your scene. By the end of the book, you'll know everything that is required to create 3D animated graphics that run in any browser using Three.js.
What You Will Learn
- Use the different geometries that are provided by Three.js
- Apply realistic lighting and shadows to the 3D objects you have created
- Use the different camera controls provided by Three.js to effortlessly navigate around your 3D scene
- Make use of advanced textures on materials to create realistic-looking 3D objects by using bump maps, normal maps, specular maps, and light maps
- Import and animate models from external formats, such as OBJ, STL, Collada, and many more
- Create and run animations using morph targets and bone animations
- Explore the Physijs JavaScript library to apply physics to your 3D objects
- Interact directly with WebGL by creating custom vertex and fragment shaders
Table of contents
-
Learning Three.js – the JavaScript 3D Library for WebGL Second Edition
- Table of Contents
- Learning Three.js – the JavaScript 3D Library for WebGL Second Edition
- Credits
- About the Author
- Acknowledgments
- About the Reviewers
- www.PacktPub.com
- Preface
-
1. Creating Your First 3D Scene with Three.js
- Requirements to use Three.js
- Getting the source code
- Creating the HTML skeleton
- Rendering and viewing a 3D object
- Adding materials, lights, and shadows
- Expanding your first scene with animations
- Using dat.GUI to make experimenting easier
- Automatically resize the output when browser size changes
- Summary
- 2. Basic Components That Make Up a Three.js Scene
- 3. Working with the Different Light Sources Available in Three.js
- 4. Working with Three.js Materials
- 5. Learning to Work with Geometries
- 6. Advanced Geometries and Binary Operations
- 7. Particles, Sprites, and the Point Cloud
- 8. Creating and Loading Advanced Meshes and Geometries
- 9. Animations and Moving the Camera
- 10. Loading and Working with Textures
- 11. Custom Shaders and Render Postprocessing
-
12. Adding Physics and Sounds to Your Scene
- Creating a basic Three.js scene
- Material properties
- Basic supported shapes
-
Using constraints to limit movement of objects
- Using PointConstraint to limit movement between two points
- Creating door-like constraints with HingeConstraint
- Limiting movement to a single axis with SliderConstraint
- Creating a ball-and-socket-joint-like constraint with ConeTwistConstraint
- Creating detailed control with DOFConstraint
- Add sound sources to your scene
- Summary
- Index
Product information
- Title: Learning Three.js – the JavaScript 3D Library for WebGL - Second Edition
- Author(s):
- Release date: March 2015
- Publisher(s): Packt Publishing
- ISBN: 9781784392215
You might also like
video
Programming 3D Applications in HTML5 and WebGL
Learn how to create high-performance, visually stunning 3D applications for the Web hands-on, using HTML5 and …
book
Programming 3D Applications with HTML5 and WebGL
Create high-performance, visually stunning 3D applications for the Web, using HTML5 and related technologies such as …
book
WebGL Beginner's Guide
If you’re a JavaScript developer who wants to take the plunge into 3D web development, this …
book
Three.js Cookbook
Over 80 shortcuts, solutions, and recipes that allow you to create the most stunning visualizations and …