Namespace vxl.def.camera

Default values for cameras

Namespace

vxl.def.camera
Defines the constants that can be used with vxlCamera

Fields

<static> vxl.def.camera.far
Default value for the far field: 10000
<static> vxl.def.camera.fov
Default field of view value: 30
<static> vxl.def.camera.near
Default value for the near field: 0.1
<static> vxl.def.camera.normal
Camera axial or normal vector constant: [0,0,1]
<static> vxl.def.camera.right
Right vector constant: [1,0,0]
<static> vxl.def.camera.tracking

Defines the tracking modes available for instances of vxlCamera

A tracking mode is only required when the camera is set to follow an actor using vxlCamera#follow

The tracking modes can be:

  • DEFAULT: The camera does not follow an actor. Controlled by the user to look around the world.
  • ROTATIONAL: The camera does not move but follows an actor position
  • TRANSLATIONAL: The camera moves with the actor, the angle is constant
  • CINEMATIC: Similar to ROTATIONAL but allowing camera roll for a more dramatic effect

to set the tracking mode 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);
See:
vxlCamera#follow, vxlCamera#setTrackingMode
<static> vxl.def.camera.type
Camera type available

The camera type can be:

  • ORBITING: Orbiting Camera - Around the World
  • TRACKING: Tracking Camera - First Person Camera
  • EXPLORING: Camera axes are updated on every rotation

These modes can be used with the vxlCamera constructor or with its setType method

<static> vxl.def.camera.up
Up vector constant: [0,1,0]