VUE Camera transforms: Difference between revisions

From DF21 Wiki
(Created page with "Dark Forces has built-in support for transforming a camera's location and orientation with '''VUE files'''. This functionality was "discovered" when the source code was reverse engineered. The camera in DF is normally called the "EYE object". The EYE (camera) is assigned to an object at level startup and is normally assigned to the PLAYER object, but this is not mandatory, and there are a few mods which exploit the possibility of separate PLAYER and EYE objects. Vanill...")
 
No edit summary
Line 4: Line 4:


Vanilla Dark Forces does not support moving the EYE (camera) from one object to another object after level load.
Vanilla Dark Forces does not support moving the EYE (camera) from one object to another object after level load.
=== How to use ===
In a VUE file, each keyframe for the camera has the following syntax:
<code>camera [x-pos] [z-pos] [y-pos] [x-target] [z-target] [y-target] [roll] [lens]</code>
* <code>x-pos z-pos y-pos</code> are the location (absolute) of the camera in the map
* <code>x-target z-target y-target</code> are the coordinates where the camera is pointing at. The camera's yaw and pitch orientation are calculated from the vector between the camera's location and its target.
* <code>roll</code> is the camera's roll (note: rolling of the camera is not supported by DF's renderer; no matter what number is set here, the scene will always be rendered with a roll of 0)
* <code>lens</code> is presumably meant to be a zoom factor, which is not used by the DF engine.
Examples of camera instructions can be seen in the VUE files used for the original Gromas and Detention levels.
'''Note:''' Vanilla DF did not calculate the camera's pitch, therefore pitch will always be set at 0. In The Force Engine, the code has been amended to calculate the pitch.

Revision as of 05:25, 22 November 2024

Dark Forces has built-in support for transforming a camera's location and orientation with VUE files. This functionality was "discovered" when the source code was reverse engineered.

The camera in DF is normally called the "EYE object". The EYE (camera) is assigned to an object at level startup and is normally assigned to the PLAYER object, but this is not mandatory, and there are a few mods which exploit the possibility of separate PLAYER and EYE objects.

Vanilla Dark Forces does not support moving the EYE (camera) from one object to another object after level load.

How to use

In a VUE file, each keyframe for the camera has the following syntax:

camera [x-pos] [z-pos] [y-pos] [x-target] [z-target] [y-target] [roll] [lens]

  • x-pos z-pos y-pos are the location (absolute) of the camera in the map
  • x-target z-target y-target are the coordinates where the camera is pointing at. The camera's yaw and pitch orientation are calculated from the vector between the camera's location and its target.
  • roll is the camera's roll (note: rolling of the camera is not supported by DF's renderer; no matter what number is set here, the scene will always be rendered with a roll of 0)
  • lens is presumably meant to be a zoom factor, which is not used by the DF engine.

Examples of camera instructions can be seen in the VUE files used for the original Gromas and Detention levels.

Note: Vanilla DF did not calculate the camera's pitch, therefore pitch will always be set at 0. In The Force Engine, the code has been amended to calculate the pitch.