Working with axis orientation origin

From Valve Developer Community
Revision as of 13:48, 8 March 2009 by Thepaperdog (talk | contribs) (New page: ==WORKING WITH ROTATION AND AXES== '''Introduction:''' Most, if not all dynamic prop objects from the SDK Source can be rotated. Objects can be rotated around all three axes: '''Pitch...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

WORKING WITH ROTATION AND AXES

Introduction:

Most, if not all dynamic prop objects from the SDK Source can be rotated.

Objects can be rotated around all three axes: Pitch Yaw Roll (Y Z X). A common difficulty with rotating objects is getting them to rotate (as we would naturally expect them to), no matter what and where their orientation and position on the map is.


Rotation Around The Axis:

Rotation around the axis is measured as the movement of a line's angle (expressed as degrees). A line's angle can be incremented from 0 to 359 degrees, around a given axis. The (Y Z X) values within a given prop are determined by the physical orientation of the prop, with respect to a given origin. Below is a description of the three-dimensional axes

  • Pitch (Y) - Forward/Backward rotation
  • Yaw (Z) - Directional (North, South, East, West) rotation
  • Roll (X) - Tilt (right,Left) Rotation

WORKING WITH ORIENTATION

Orientation of a prop can be described by the line angles at axes's vector (The point where the three axes intersect each other). The following description will attempt to explain how orientation effects how we percieve rotation around the axis.

Suppose you have a pen.

  • If you hold the pen vertically (upright) in front of you, the pitch orientation of the pen is 90 degrees (Y). Yet, While holding the pen, if you unscrew its cap, the rotation of the cap occurs (counter-clockwise direction) along the (Z) axis.
  • Take the same pen and hold it horizontally (on its side) in front of you. The cap now rotates (back, toward you) along the (Y) axis.
  • Finally, swivel the pen (while it is horizontal) so that you can only see one end of it in front of you. Now the cap rotates (left) along the (X) axis.

In each case, the axes changed, simply from re-orientation of the pen. This illustrates the impact of relative perspective. If the pen exercise had been conducted on the south edge of a circle, and another person observed the exercise from the west edge of the circle, the rotation along the (X) axis, as percieved from the south edge, would be a rotation along the (Y) axis, as percieved from the west edge, and so on.

In Valve's world, the absolute center of the universe is a fixed origin in the map. Therefore, development of an object's (X Y Z) settings might not appear at times to make sense from a relative perspective.