Class links.Graph3d.Camera
Camera
The camera is mounted on a (virtual) camera arm. The camera arm can rotate
The camera is always looking in the direction of the origin of the arm.
This way, the camera always rotates around one fixed point, the location
of the camera arm.
Documentation:
http://en.wikipedia.org/wiki/3D_projection
Defined in: graph3d.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
Calculate the location and rotation of the camera based on the
position and orientation of the camera arm
|
|
Retrieve the arm length
|
|
Retrieve the current arm rotation
|
|
Retrieve the camera location
|
|
Retrieve the camera rotation
|
|
setArmLength(length)
Set the (normalized) length of the camera arm.
|
|
setArmLocation(x, y, z)
Set the location (origin) of the arm
|
|
setArmRotation(horizontal, vertical)
Set the rotation of the camera arm
|
Method Detail
calculateCameraOrientation()
Calculate the location and rotation of the camera based on the
position and orientation of the camera arm
{number}
getArmLength()
Retrieve the arm length
- Returns:
- {number} length
{object}
getArmRotation()
Retrieve the current arm rotation
- Returns:
- {object} An object with parameters horizontal and vertical
{links.Point3d}
getCameraLocation()
Retrieve the camera location
- Returns:
- {links.Point3d} cameraLocation
{links.Point3d}
getCameraRotation()
Retrieve the camera rotation
- Returns:
- {links.Point3d} cameraRotation
setArmLength(length)
Set the (normalized) length of the camera arm.
- Parameters:
- {number} length
- A length between 0.71 and 5.0
setArmLocation(x, y, z)
Set the location (origin) of the arm
- Parameters:
- {number} x
- Normalized value of x
- {number} y
- Normalized value of y
- {number} z
- Normalized value of z
setArmRotation(horizontal, vertical)
Set the rotation of the camera arm
- Parameters:
- {number} horizontal
- The horizontal rotation, between 0 and 2*PI. Optional, can be left undefined.
- {number} vertical
- The vertical rotation, between 0 and 0.5*PI if vertical=0.5*PI, the graph is shown from the top. Optional, can be left undefined.