Three.js Tutorial
Selected Reading
- Three.js - Discussion
- Three.js - Useful Resources
- Three.js - Quick Guide
- Three.js - Libraries and Plugins
- Three.js - Loading 3D Models
- Three.js - Creating Text
- Three.js - Animations
- Three.js - Drawing Lines
- Three.js - Textures
- Three.js - Materials
- Three.js - Geometries
- Three.js - Lights & Shadows
- Three.js - Controls
- Three.js - Cameras
- Three.js - Debug and Stats
- Three.js - Responsive Design
- Three.js - Renderer and Responsiveness
- Three.js - Hello Cube App
- Three.js - Installation
- Three.js - Introduction
- Three.js - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Three.js - Cameras
Three.js - Cameras
Types of Cameras
There are two types of cameras are in Three.js.
Sr.No | Cameras & Description |
---|---|
1 | There are different cameras in Three.js. The most common camera and the one we ve been using is the PerspectiveCamera. |
2 | The 2nd most common camera is the OrthographicCamera. It specifies a box with the settings left, right top, bottom, near, and far. It represents three-dimensional objects in two dimensions. |
Making the Camera Follow an Object
In the animation function, we use the camera.lookAt function to point the camera to the position function of the object. We do this in every frame that we render. It looks pke the camera is exactly following the object s position.
function animate() { const object = scene.getObjectByName( sphere ) renderer.render(scene, camera) camera.lookAt(object.position) requestAnimationFrame(render) }Advertisements