Camera
From Gnoll's Wiki
Contents |
Description
Gnoll use a camera system over the Ogre3D system. It provided to you different sorts of camera:
- Camera free fly: with a free camera, you can go where you want. It generaly used to debug scenes but it can be used in a specific context.
- Camera third person: a camera at the third person, means that the camera is behind a target(that you can chose) with a chosen distance, rotations are around this target and the movements of the camera depend of the movements of the target.
- Camera first person: a camera at the first person,means that the camera is in a target(that you can also choose), his movements depend of the movements of the target.
- Camera spline:a camera ignored but very usefull, you can set an animation, means by set the position where it pass and at what the moment. it take care of tracing a spline(mathematics sens) for find a way between those point and realises the animation.
- Camera fixe: a standard and basic camera, this is a camera that you can easily put and position in a scene.
Features
| Target | Orbital Rotation | Axial Rotation | Spline | Strafing | |
| Camera free fly | No | Yes | Yes | No | Yes |
| Camera third person | Yes | Yes | No | No | No |
| Camera first person | Yes | No | Yes | No | No |
| Camera spline | Yes | No | No | Yes | No |
| Camera fixe | Yes | No | No | No | No |
Examples
Configuring files
gScenemanager: This dynamic object contains information about the global scene (cameras, lights, pages, etc.)
<dynamicobject instance="gSceneManager">
<attribute name="currentCamera">
<string value="camera.camfreefly"/>
</attribute>
...
</dynamicobject>
Important:
- The attribute name is important, in the code, Gnoll will search for this name.
- The name of the Camera Dynamic Object is VERY IMPORTANT, it should be of the form NAME.TYPE_CAMERA (example : camera.camfreefly)
Camera type list:
- camfreefly
- camfirstperson
- camthirdperson
- camfixe
- camspline
Configuring camera
All values can be change at your need.
Camera free fly
<dynamicobject instance="camera.camfreefly">
<attribute name="Direction">
<vector3 x="0.09020296" y="0.08760853" z="-0.9920626"/>
</attribute>
<attribute name="MOVE_BACK">
<float value="1"/>
</attribute>
<attribute name="MOVE_FORWARD">
<float value="1"/>
</attribute>
<attribute name="MaximumRotationAroundX">
<float value="500"/>
</attribute>
<attribute name="MaximumRotationAroundY">
<float value="500"/>
</attribute>
<attribute name="Position">
<vector3 x="0" y="0" z="0"/>
</attribute>
<attribute name="ROTATION_AXIS_X">
<float value="1"/>
</attribute>
<attribute name="ROTATION_AXIS_Y">
<float value="1"/>
</attribute>
<attribute name="ROTATION_AXIS_Z">
<float value="1"/>
</attribute>
<attribute name="STRAFE_DOWN">
<float value="1"/>
</attribute>
<attribute name="STRAFE_LEFT">
<float value="1"/>
</attribute>
<attribute name="STRAFE_RIGHT">
<float value="1"/>
</attribute>
<attribute name="STRAFE_UP">
<float value="1"/>
</attribute>
<attribute name="Target">
<string value=""/>
</attribute>
<attribute name="dir_x">
<float value="-0.87225"/>
</attribute>
<attribute name="dir_y">
<float value="-0.3041443"/>
</attribute>
<attribute name="dir_z">
<float value="-0.3829793"/>
</attribute>
<attribute name="far">
<float value="0"/>
</attribute>
<attribute name="fov">
<float value="0.785"/>
</attribute>
<attribute name="name">
<string value="camera.camfreefly"/>
</attribute>
<attribute name="near">
<float value="1"/>
</attribute>
<attribute name="pos_x">
<float value="873.174"/>
</attribute>
<attribute name="pos_y">
<float value="52.26911"/>
</attribute>
<attribute name="pos_z">
<float value="620.8526"/>
</attribute>
</dynamicobject>
Camera first person
<dynamicobject instance="camera.camfirstperson">
<attribute name="Direction">
<vector3 x="0" y="0" z="-1"/>
</attribute>
<attribute name="HeadPosition">
<vector3 x="7.343328e-34" y="1000" z="7.343374e-34"/>
</attribute>
<attribute name="MOVE_BACK">
<float value="1"/>
</attribute>
<attribute name="MOVE_FORWARD">
<float value="1"/>
</attribute>
<attribute name="Position">
<vector3 x="0" y="0" z="0"/>
</attribute>
<attribute name="ROTATION_AXIS_X">
<float value="1"/>
</attribute>
<attribute name="ROTATION_AXIS_Y">
<float value="1"/>
</attribute>
<attribute name="ROTATION_AXIS_Z">
<float value="1"/>
</attribute>
<attribute name="STRAFE_DOWN">
<float value="1"/>
</attribute>
<attribute name="STRAFE_LEFT">
<float value="1"/>
</attribute>
<attribute name="STRAFE_RIGHT">
<float value="1"/>
</attribute>
<attribute name="STRAFE_UP">
<float value="1"/>
</attribute>
<attribute name="Target">
<string value=""/>
</attribute>
<attribute name="far">
<float value="0"/>
</attribute>
<attribute name="fov">
<float value="0.785"/>
</attribute>
<attribute name="name">
<string value="camera.camfirstperson"/>
</attribute>
<attribute name="near">
<float value="1"/>
</attribute>
</dynamicobject>
Camera third person
<dynamicobject instance="camera.camthirdperson">
<attribute name="Direction">
<vector3 x="0" y="0" z="-1"/>
</attribute>
<attribute name="MOVE_BACK">
<float value="1"/>
</attribute>
<attribute name="MOVE_FORWARD">
<float value="1"/>
</attribute>
<attribute name="Position">
<vector3 x="0" y="0" z="0"/>
</attribute>
<attribute name="ROTATION_AXIS_X">
<float value="1"/>
</attribute>
<attribute name="ROTATION_AXIS_Y">
<float value="1"/>
</attribute>
<attribute name="ROTATION_AXIS_Z">
<float value="1"/>
</attribute>
<attribute name="STRAFE_DOWN">
<float value="1"/>
</attribute>
<attribute name="STRAFE_LEFT">
<float value="1"/>
</attribute>
<attribute name="STRAFE_RIGHT">
<float value="1"/>
</attribute>
<attribute name="STRAFE_UP">
<float value="1"/>
</attribute>
<attribute name="Target">
<string value=""/>
</attribute>
<attribute name="amountRotationOnAxisX">
<float value="0"/>
</attribute>
<attribute name="amountRotationOnAxisY">
<float value="0"/>
</attribute>
<attribute name="amountRotationOnAxisZ">
<float value="0"/>
</attribute>
<attribute name="far">
<float value="0"/>
</attribute>
<attribute name="fov">
<float value="0.785"/>
</attribute>
<attribute name="limitRotationOnAxisX">
<float value="-1"/>
</attribute>
<attribute name="limitRotationOnAxisY">
<float value="-1"/>
</attribute>
<attribute name="limitRotationOnAxisZ">
<float value="-1"/>
</attribute>
<attribute name="maxOffset">
<float value="200"/>
</attribute>
<attribute name="minOffset">
<float value="0"/>
</attribute>
<attribute name="name">
<string value="camera.camthirdperson"/>
</attribute>
<attribute name="near">
<float value="1"/>
</attribute>
<attribute name="offset">
<float value="100"/>
</attribute>
</dynamicobject>
Camera fixe
<dynamicobject instance="camera.camfixe">
<attribute name="Direction">
<vector3 x="0" y="0" z="-1"/>
</attribute>
<attribute name="MOVE_BACK">
<float value="1"/>
</attribute>
<attribute name="MOVE_FORWARD">
<float value="1"/>
</attribute>
<attribute name="Position">
<vector3 x="0" y="0" z="0"/>
</attribute>
<attribute name="ROTATION_AXIS_X">
<float value="1"/>
</attribute>
<attribute name="ROTATION_AXIS_Y">
<float value="1"/>
</attribute>
<attribute name="ROTATION_AXIS_Z">
<float value="1"/>
</attribute>
<attribute name="STRAFE_DOWN">
<float value="1"/>
</attribute>
<attribute name="STRAFE_LEFT">
<float value="1"/>
</attribute>
<attribute name="STRAFE_RIGHT">
<float value="1"/>
</attribute>
<attribute name="STRAFE_UP">
<float value="1"/>
</attribute>
<attribute name="Target">
<string value=""/>
</attribute>
<attribute name="far">
<float value="0"/>
</attribute>
<attribute name="fov">
<float value="0.785"/>
</attribute>
<attribute name="name">
<string value="camera.camfixe"/>
</attribute>
<attribute name="near">
<float value="1"/>
</attribute>
</dynamicobject>
