PerspectiveCamera Class
Perspective camera, used for 3D scenes with objects getting smaller as they get away from the camera.
Based on PerspectiveCamera, original documentation available at https:// threejs.org/docs/index.html#Reference/Cameras/PerspectiveCamera.
Item Index
Properties
Methods
destroy
()
Destroy camera object and remove it from the scene.
render
-
renderer
-
scene
Render a scene using this camera and the internal EffectComposer.
Parameters:
-
renderer
WebGLRendererWebGL renderer to use.
-
scene
SceneScene to be rendered.
resize
-
x
-
y
-
viewport
Resize this camera, should be called every time after resizing the screen.
Updates the viewport, rendering composer and the camera projection matrix.
Parameters:
-
x
NumberWidth of the screen.
-
y
NumberHeight of the screen.
-
viewport
ViewportViewport that encapsulates the viewport of the camera.
setupRenderer
-
renderer
Prepare the renderer to render the frame using the camera settings.
Should be called before the render() method to setup clear configuration and viewport.
Parameters:
-
renderer
WebGLRendererWebGL renderer to configure.
updateProjectionMatrix
()
Update camera projection matrix.
Should be called after chaging projection parameters.
Properties
aspect
Number
Camera aspect ratio X/Y.
Default: 1.0
clearColor
Boolean
Clear screen color flag.
Default: false
clearDepth
Boolean
Clear depth flag.
Default: false
clearDepth
Boolean
Clear stencil buffer flag.
Default: false
composer
EffectComposer
Effect composed of this camera. Is used to render the scene to the screen and apply effects.
It is inialized with a RenderPass attached to it.
fov
Number
Camera field of view in degrees.
Default: 50
order
Number
Camera draw order preference.
If more than one camera has the same order value the draw order is undefined for those cameras.
Default: 0
zoom
Number
Camera zoom.
Default: 1.0