Class Camera
Represents a camera with a point of view over a 3D scene.
Defined in: benchgl.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Camera(options)
Creates a new Camera.
|
Method Attributes | Method Name and Description |
---|---|
model()
Gets this Camera's model stack.
|
|
Gets the model matrix of this Camera.
|
|
Gets the modelView matrix of this Camera.
|
|
proj()
Gets this Camera's projection stack.
|
|
Gets the projection matrix of this Camera.
|
|
reset()
Resets this Camera, loading identity matrices on top of the view and model stacks.
|
|
update()
Updates this Camera's local reference frame.
|
|
view()
Gets this Camera's view stack.
|
|
Gets the view matrix of this Camera.
|
Class Detail
Camera(options)
Creates a new Camera.
- Parameters:
- {Object} options
- The options to set up this Camera.
- {Number} options.fovy
- The field of view vertical angle.
- {Number} options.aspect
- The aspect ratio.
- {Number} options.near
- The near clipping plane.
- {Number} options.far
- The far clipping plane.
- {Number[]} options.eye Optional
- The position vector of this Camera.
- {Number[]} options.direction Optional
- The viewing direction vector of this Camera.
- {Number[]} options.up Optional
- The up vector of this Camera.
Method Detail
{MatrixStack}
model()
Gets this Camera's model stack.
- Returns:
- {MatrixStack} A model matrix stack
{Matrix4}
modelMatrix()
Gets the model matrix of this Camera.
- Returns:
- {Matrix4} A matrix representing a common transformation to apply to the scene.
{Matrix4}
modelViewMatrix()
Gets the modelView matrix of this Camera.
- Returns:
- {Matrix4} A matrix representing the full tranformation from object to camera space.
{MatrixStack}
proj()
Gets this Camera's projection stack.
- Returns:
- {MatrixStack} A projection matrix stack.
{Matrix4}
projMatrix()
Gets the projection matrix of this Camera.
- Returns:
- {Matrix4} A matrix representing a projective transformation.
reset()
Resets this Camera, loading identity matrices on top of the view and model stacks.
update()
Updates this Camera's local reference frame.
{MatrixStack}
view()
Gets this Camera's view stack.
- Returns:
- {MatrixStack} A view matrix stack
{Matrix4}
viewMatrix()
Gets the view matrix of this Camera.
- Returns:
- {Matrix4} A matrix representing a transformation from world to camera space.