camera
Tag: camera
Parent tag: cameras
Attributes: name – string
Child tags:
viewport(string) – the name of a previously defined viewportPOSITION(vec4) – default 0.0f, 0.0f, 0.0f, 1.0fVIEW(vec4) – default 0.0f, 0.0f, -1.0f, 0.0fLOOK_AT_POINT(vec4) – default 0.0f, 0.0f, -1.0f, 1.0fZX_ANGLE(float) – default 3.14159ELEVATION_ANGLE(float) – default 0.0UP– vec4 (default 0.0f, 1.0f, 0.0f, 0.0fFOV(float) – default 60.0NEARP(float) – default 1.0FARP(float) – default 1000.0LEFT(float) – default -1.0RIGHT(float) – default 1.0TOP(float) – default 1.0BOTTOM(float) – default -1.0TYPE(enum) – possible values: {PERSPECTIVE,ORTHO} (defaultPERSPECTIVE)
Description:
This tag defines a camera. The camera type can be “PERSPECTIVE” or “ORTHO”, and different sets of attributes apply. The attributes LEFT, RIGHT, TOP, and BOTTOM are only meaningful for orthographic cameras. These attributes together with NEARP and FARP, the distance to the near and far planes, respectively, define the view frustum.
For perspective cameras the frustum is defined with FOV, the vertical field of view, NEARP, and FARP.
The camera direction can be defined in three different ways using:
VIEW– defines the view directionLOOK_AT_POINT– the view direction is built asLOOK_AT_POINT - POSITIONZX_ANGLEandELEVATION_ANGLE– These are spherical coordinates (in radians) for the view direction. TheZX_ANGLEis zero when the view direction points in the positive Z axis. TheELEVATION_ANGLEis zero when the view direction is horizontal.
Examples:
– Setting camera with position and view direction:
<camera name="MainCamera" > <viewport name="MainViewport" /> <POSITION x=-0.8143 y=1.066161 z=1.525997 /> <VIEW x=0.300459 y=-0.560906 z=-0.771433 /> </camera>
– Setting camera with spherical coordinates
<camera name="MainCamera" > <viewport name="MainViewport" /> <TYPE value="PERSPECTIVE"/> <FOV value=60/> <NEARP value= 1/> <FARP value= 100/> <POSITION x=-16.4 y=9 z=-14.2 /> <ZX_ANGLE value = 0.76/> <ELEVATION_ANGLE value=-0.24/> <UP x=0 y=1 z=0 /> </camera>