Determines which region of the scene will be visible to the user.
A vxlCamera is always associated to one vxlView
object. However, one vxlView object can host multiple
cameras (through its vxlCameraManager
)
Parameters:
vxlView |
p_view
|
|
Object |
p_type
|
the type of camera |
Parameters:
Type | Name | Description |
---|---|---|
Number |
el
|
the azimuth increment in degrees |
Parameters:
Type | Name | Description |
---|---|---|
Number |
el
|
the elevation increment in degrees |
Parameters:
Type | Name | Description |
---|---|---|
Number |
rl
|
the roll increment in degrees |
Parameters:
Type | Name | Description |
---|---|---|
String|vxlActor |
actor
|
The name of the actor or the actor object this camera will look at. |
See:
Close-up (Wikipedia)Parameters:
Type | Name | Description |
---|---|---|
String |
name
|
the landmark given name |
Array|vec3 |
position
|
the position of this landmark |
Array|vec3 |
focalPoint
|
the desired focalPoint for the camera at the landmark |
roll
|
|
See:
vxlLandmarkParameters:
Type | Name | Description |
---|---|---|
steps
|
|
Parameters:
Type | Name | Description |
---|---|---|
Number |
value
|
the dollying value |
Parameters:
Type | Name | Description |
---|---|---|
vxlActor|String |
actor
|
actor to track (It can be the actor name or the actor instance) |
String |
trackingType
|
one of the possible values of |
See:
Returns:
{mat4} m the Model-View Transform |
Parameters:
Type | Name | Description |
---|---|---|
String |
name
|
the landmark name |
Number |
length
|
(optional) the duration of the animation |
Number |
fps
|
(optional) the number of frames per second (estmate) two landmarks. |
See:
vxlLandmarkSee:
Long Shot (Wikipedia)Parameters:
Type | Name | Description |
---|---|---|
String|vxlActor |
actor
|
The name of the actor or the actor object this camera will look at. |
Parameters:
Type | Name | Description |
---|---|---|
Number |
dx
|
the horizontal displacement |
Number |
dy
|
the vertical displacement |
Parameters:
Type | Name | Description |
---|---|---|
Number |
azimuth
|
the relative azimuth |
Number |
elevation
|
the relative elevation |
Number |
roll
|
the relative roll |
Forces the aspect ratio of the camera to a certain value.
To go back to the default aspect ratio that relies on the dimensions
of the view associated to this camera use:
setAspectRatio(undefined)
Parameters:
Type | Name | Description |
---|---|---|
Number |
p_aspect
|
the new aspect ratio |
Parameters:
Type | Name | Description |
---|---|---|
Number |
el
|
the azimuth in degrees |
Parameters:
Type | Name | Description |
---|---|---|
Number |
d
|
the distance |
Parameters:
Type | Name | Description |
---|---|---|
Number |
el
|
the elevation in degrees |
Parameters:
Type | Name | Description |
---|---|---|
Number|Array|vec3 |
x
|
it can be the x coordinate, a 3-dimensional Array or a vec3 (glMatrix) |
Number |
y
|
if x is a number, then this parameter corresponds to the y-coordinate |
Number |
z
|
if x is a number, then this parameter corresponds to the z-coordinate |
Parameters:
Type | Name | Description |
---|---|---|
String |
name
|
the landmark name |
See:
vxlLandmarkParameters:
Type | Name | Description |
---|---|---|
mat4 |
matrix
|
the new camera matrix |
Parameters:
Type | Name | Description |
---|---|---|
Number |
p_near
|
the distance from the camera to the near plane |
Number |
p_far
|
the distance from the camera to the far plane |
Number |
p_angle
|
the vertical field of view in degrees |
Number |
p_aspect
|
the desired aspect ratio (optional). If not defined the camera automatically selects the current width/height radio of the respective view. |
Sets the camera position in the scene This method has three parameters x,y,z which represent the coordinates for the camera's position.
This method takes into account the current focal point. The camera will look at the
focal point after this operation. If you want to move the camera position and the focal point
simultaneously, then use vxlCamera.translate
.
Parameters:
Type | Name | Description |
---|---|---|
Number |
y
|
the y-coordinate |
Number |
z
|
the z-coordinate |
z
|
|
Parameters:
Type | Name | Description |
---|---|---|
Number |
angle
|
the roll angle |
To set the tracking type of the camera myCamera
you should make sure that your camera is of tracking type with:
myCamera.setType(vxl.def.camera.type.TRACKING)
.
For instance:
var actor = vxl.api.getActor('cone'); //from the current scene var camera = vxl.c.camera; camera.setType(vxl.def.camera.type.TRACKING); camera.setTrackingMode(vxl.def.camera.tracking.ROTATIONAL); camera.follow(actor);
a shorter way would be:
var actor = vxl.api.getActor('cone'); //from the current scene var camera = vxl.c.camera; camera.setType(vxl.def.camera.type.TRACKING); camera.follow(actor, vxl.def.camera.tracking.ROTATIONAL);
Parameters:
Type | Name | Description |
---|---|---|
mode
|
|
See:
vxlCamera#follow, vxl.def.camera.trackingParameters:
Type | Name | Description |
---|---|---|
vxl.def.camera.type |
p_type
|
the type of camera |
vxl.def.camera.tracking |
p_tracking_mode
|
if the camera is of tracking type, the tracking mode can be set as an optional parameter here. |
See:
vxl.def.camera.type, vxl.def.camera.trackingParameters:
Type | Name | Description |
---|---|---|
flag
|
|
Parameters:
Type | Name | Description |
---|---|---|
Number|Array|vec3 |
x
|
it can be the x coordinate, a 3-dimensional Array or a vec3 (glMatrix) |
Number |
y
|
if x is a number, then this parameter corresponds to the y-coordinate |
Number |
z
|
if x is a number, then this parameter corresponds to the z-coordinate |
Parameters:
Type | Name | Description |
---|---|---|
vxlActor |
actor
|
the actor being followed by this camera |