Half Life coordinate system - advancedfx/advancedfx GitHub Wiki

Half-Life 1 coordinate system

Half-Life coordinate system graphic

The image above shows the internal left-handed Half-Life 1 coordinate system, which is equivalent to the Quake 1 coordinate system:

  • Red: X-axis (forward / thumb)
  • Green: Y-axis (left / second finger)
  • Blue: Z-axis (up / first finger)
  • Cyan: skybox planes, the text reflects the sky image orientation and order accordingly

The labels "pitch" and "yaw" reflect the engine definition and are different from definitions in aviation!

Rotation direction

See Right-hand grip rule.

Rotation order

  1. X-axis (Roll)
  2. Y-axis (Pitch)
  3. Z-axis (Yaw)

Detailed information

DemoEdit coordinates

DemoEdit coordinates image

The position and angles are coded in the Half-Life order as shown in the image above (color codes and namings as in Half-Life coordinate system image in the previous section).

Negative values

While you can enter negative values, and those will work correctly, the dialogue will display negative values as values greater or equal to 4096.0:

Let x be the value Valve's Campath dialog displays then:
0.0 <= x < 4096.0 --> real value = x
4096.0 <= x < 8192.0 --> real value = 8192-x

Example:

The Dialog displays a value of 8101.75.

This value is greater than 4096, so we subtract 8192: 8101.75 - 8192 = -90.25

So the real value is -90.25.

Precision

Btw Valve's DemoEdit precision of the stored values of the control points is as follows:

16 bit = 1 bit for sign + 12 bit before the point + 3 bit after the point

This means:
Greatest possible value = +4095.875
Smallest possible value = -4096.000 (?)
Smallest non zero difference between two values = +/- 0.125

Of course, the interpolation between the values / control points is much smoother.

Interpolation

The location / position is probably interpolated using quadratic (degree 2) polynomial splines.

The view angles are probably interpolated linearly.

See also

⚠️ **GitHub.com Fallback** ⚠️