Returns the far clipping plane
Returns the total field of view in the Y direction in degrees.
Returns undefined if parallel (orthographic) projection
Get height of the view frustum in the front plane in world coordinates.
Returns the near clipping plane
Returns the current projection type (perspective/ortho)
Returns the current view matrix
Calculate the camera position required to fit the given bounding box in the view when the camera is orientated with the given direction and up vectors.
Disables the auto clipping feature
Enables the auto clipping feature and sets a fixed near distance
Enables the auto clipping feature and sets a minimum near distance
Sets up the view to contain the passed bounding box, with the camera looking from the given direction (dir) and with the given up vector (up).
The passed boundingBox should be the bounding box of the object/model you would like to fit the view to.
The relativeDistance parameter specifies the distance from the camera to the center of the bounding box.
Note: This only works for perspective projection. For orthographic (parallel) projections, use the fitViewOrtho method.
Sets up the view to contain the passed bounding box, with the camera looking from the given direction 'dir', at the give distance 'eyeDist' and with the given up vector 'up'.
We recommend to set the 'eyeDist' to boundingBox.radius()*2.0
The passed boundingBox should be the bounding box of the object/model you would like to fit the view to.
Note: This only works for orthographic (parallel) projection. For perspective projections, use the fitView method.
Returns camera's forward direction vector. The returned vector is normalized.
Returns the camera's position (eye point)
Returns the camera's up vector. The returned vector is normalized.
Maps world (3d) coordinates to window coordinates
The returned window coordinates \a out are in WebGL/OpenGL style coordinates, which means a right handed coordinate system with the origin in the lower left corner of the window.
OpenGL like project.
Sets the front and back clipping planes close to the given bounding box
Sets up a orthographic (parallel) projection.
The height parameter is the height of the frustum. A good default is the length of the extent of the current bounding box.
Sets up a perspective projection.
The fieldOfViewYDeg parameter is the total field of view angle (in degrees) in the Y direction. Works similar to gluPerspective().
Sets a handler to be invoked each time the camera view changes
The handler to invoke on change
If true, the handler will only be invoked after any ongoing mouse operations or camera animations have completed. Note that setting this to false will result in a large number of handler invocations, while setting this to true and then starting a never-ending camera animation will result in no invocations.
Sets the view matrix of the camera.
Maps window coordinates to world (3d) coordinates
The input (window) coordinates \a coord must be specified in WebGL/OpenGL style coordinates, which means a right handed coordinate system with the origin in the lower left corner of the window.
OpenGL like unproject.
Use Viewer.oglWinPosFromClientCoord to convert client coordinates into WebGL style coordinates
Zoom in/out so the given bounding box will fill the view.
This is done without changing the current camera position. It works for both for PERSPECTIVE and ORTHO projection types.
Note: Works best with ZOOM navigation. Combining zoom (changing FOV) and walk navigation can give distorted views.
Generated using TypeDoc
Camera settings (view point and projection) for a View.
Use this class to get a View's current eye point, view direction and up vector.
Setup the camera by providing the eye, view reference point (center) and up vector to setFromLookAt.
You can also use this class to setup the projection and control the front and back clipping planes.
You can access a View's camera with the View.camera property.