Camera
-
class
Camera
() Object representing a viewpoint from which the scene can be rendered. More information about using Camera can be found here.
Constructors
Methods
copy()
dolly()
equals()
equalsWithTolerance()
getCameraPlaneIntersectionPoint()
getFullMatrix()
getHeight()
getNearLimit()
getPosition()
getProjection()
getProjectionMatrix()
getTarget()
getUp()
getViewMatrix()
getWidth()
setHeight()
setNearLimit()
setPosition()
setProjection()
setTarget()
setUp()
setWidth()
toJson()
transform()
create()
fromJson()
Methods
copy
-
Camera.
copy
() Creates a copy of the camera.
Returns: new object initialized with the current values of this camera Return type: Camera
dolly
equals
equalsWithTolerance
getCameraPlaneIntersectionPoint
getFullMatrix
-
Camera.
getFullMatrix
(viewer[, view]) Arguments: - viewer (
IWebViewer()
) – The [[WebViewer]] for which the matrix should be valid. - view (
IView()
) – optional the [[View]] to use when calculating projection effects. Uses default view if undefined
Returns the camera’s projection matrix multiplied by its view matrix.
Return type: Matrix - viewer (
getNearLimit
-
Camera.
getNearLimit
() gets the camera near clipping limit
Returns: the camera near clipping limit Return type: number
getPosition
-
Camera.
getPosition
() gets the camera position
Returns: the camera position Return type: Point3
getProjection
-
Camera.
getProjection
() gets the camera projection
Returns: the camera projection Return type: Projection
getProjectionMatrix
-
Camera.
getProjectionMatrix
(viewer[, view]) Arguments: - viewer (
IWebViewer()
) – The [[WebViewer]] for which the matrix should be valid. - view (
IView()
) – optional the [[View]] to use when calculating projection effects. Uses default view if undefined
Returns the camera’s projection matrix.
Return type: Matrix - viewer (
getViewMatrix
-
Camera.
getViewMatrix
(viewer) Arguments: - viewer (
IWebViewer()
) – The [[WebViewer]] for which the matrix should be valid.
Returns the camera’s view matrix. This matrix places the camera at
<0,0,0>
, with the negative z-axis pointing toward the camera’s target and the y-axis in the direction of the camera’s up-vector.Return type: Matrix - viewer (
setHeight
-
Camera.
setHeight
(height) Arguments: - height (
number()
) – the new camera height
Sets the camera height
Return type: void - height (
setNearLimit
-
Camera.
setNearLimit
(nearLimit) Arguments: - nearLimit (
number()
) – the new camera near clipping limit
Sets the camera near clipping limit
Return type: void - nearLimit (
setPosition
setProjection
-
Camera.
setProjection
(projection) Arguments: - projection (
Projection()
) – the new camera Projection
Sets the camera projection
Return type: void - projection (
setTarget
setUp
setWidth
-
Camera.
setWidth
(width) Arguments: - width (
number()
) – the new camera width
Sets the camera width
Return type: void - width (
toJson
-
Camera.
toJson
() Creates an object ready for JSON serialization.
Returns: The prepared object. Return type: object
static create
-
Camera.
create
(pos, tar, up, projection, width, height[, nearLimit]) Arguments: - pos (
Point3()
) – the camera position. - tar (
Point3()
) – the camera target. - up (
Point3()
) – the camera up vector. - projection (
Projection()
) – the camera projection mode. - width (
number()
) – camera view width. - height (
number()
) – camera view height. - nearLimit (
number()
) – optional the camera near limit.
Creates a new camera object with the given parameters.
Returns: a new camera object. Return type: Camera - pos (