Origin: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(major overhaul :-))
Line 1: Line 1:
{{stub}}
In Source, we us the word '''Origin''' to refer to both the ''Reference Point'' at the center of a  [http://en.wikipedia.org/wiki/Coordinates_%28mathematics%29 local coordinate system] ''and'' as a convenient label for that system or ''Reference Frame'' itself. <!--So "WorldOrigin" is used to refer to the World coordinate system (XYZ axes) and the origin in that system (0,0,0).-->
'''''Disambiguation:'''''


* Center of Rotation : [[QAngle]] (Pitch Yaw Roll : Y Z X)
In order to have interesting [http://en.wikipedia.org/wiki/Rigid_body interactions between solid objects] in game, Source uses a simple ''Hierarchy of Reference Frames''. At the top of the hierarchy is the '''WorldOrigin'''. A Point Entity's '''Position''' is its Location ''and'' Orientation <!--(yes, both!)--> in the World, ie its ''linear and rotational offsets'' relative to the ''WorldOrigin''. The Entity's own geometry (eg its [[angles]]) are relative to its '''EntityOrigin'''. The Entity's Position and Origin are in exactly the same point in space; and are almost the same thing. The only difference is which ''Frame of Reference'' you are looking at it from. When describing any geometric properties - vertices, angles, etc - it's very important to be clear which ''Frame of Reference'' we're referring to.
** Rotating Point Entities use their ''World Position'' unless modified by the '''[[Template:Kv_origin|origin]]''' keyvalue.
** Rotating Brush Entities require the '''[[Template:Kv_origin|origin]]''' keyvalue.
** Rotating Brush tooltexture : [[Tool_textures]]


* Offset Coordinates : (X Y Z)
* '''WorldOrigin''' : Often called the ''map origin'', this is the [[worldspawn]] entity's position in the World (0,0,0). All [[World brush]]es are part of the [[worldspawn]] entity, so their vertex coordinates are relative to the ''WorldOrigin''.  
** '''World Position''' (''geocentric'') coordinates are relative to ''World Origin'' ([[worldspawn]]).
<!--** Studiomodel : (QC) [[$origin]] and [[$autocenter]] offset/align the model's ''autocentric'' origin to its World Position.-->
** '''lightingorigin''' Entity (Rendering) Property : [[info_lighting]]


* '''EntityOrigin''' : (also called a ''placementOrigin'') defines the Entity's Location and Orientation in the World as well as its (default) Center of Rotation, Emission, etc. [[Brush entities]] which require a ''local'' origin use the '''[[Template:Kv_origin|origin]]''' keyvalue {{confirm|or the [[Tool_textures|"origin" tooltexture]]}}.
* '''ModelOrigin''' : ([[$origin]]) [[Studiomodel]] geometry also has its own reference Origin, which is aligned to the EntityOrigin. (see also [[$autocenter]], [[$illumposition]], [[$masscenter]] ).
* '''BoneOrigin''' : ([[parentbone]]) Each Studiomodel [[Bone]] is a reference point for the model's Attachments points, Vertex geometry, Animations, Joints, etc. Each bone is ultimately connected to the ''ModelOrigin'' via the [[Skeleton]] or ''bonetree hierarchy''.
Ultimately all point-positions are translated up through the hierarchy into a location and orientation relative to the WorldOrigin. However, each Reference Frame may use a different mathematical method for recording a given Position. The most familiar will probably be the WorldOrigin's XYZ [[Dimensions| Map Grid]] Coordinates for location, and PYR (Pitch Yaw Roll) [[Angles]] for orientation. Leaving [http://en.wikipedia.org/wiki/Euler_angles Euler rotations] for a very rainy day, another common way of expressing orientation is a [http://en.wikipedia.org/wiki/Surface_normal Normal Vector].
* Generally, if a local origin for a Model or Brush is not specified, it is assumed to be the geometric center of the [[Bounding box]].
* '''lightingorigin''' :see [[info_lighting]] entity and [[$illumposition]] QC command.
* '''Center of Mass''' [[$masscenter]]
* '''Center of Rotation''' : By default, an object's ''local'' Origin is used as its center of rotation.
* '''Center of Emission''' (particles, gibs, etc)
<!-- // needs work!
* Attachments and Joints ... a bone is linked to its parentbone via a joint. The joint properties (angles etc) are defined by the bone, not the parent. The child ''attaches'' to the parent. By contrast, an attachment point is part of the parent's skeleton, and when it ''attaches'' to an object, the attachment point defines the joint properties (angles, etc). This is why w_weapons are rigged with $bonemerge rather than attached ... ?
-->


[[category:Glossary]]
[[category:Glossary]]

Revision as of 19:45, 6 May 2008

In Source, we us the word Origin to refer to both the Reference Point at the center of a local coordinate system and as a convenient label for that system or Reference Frame itself.

In order to have interesting interactions between solid objects in game, Source uses a simple Hierarchy of Reference Frames. At the top of the hierarchy is the WorldOrigin. A Point Entity's Position is its Location and Orientation in the World, ie its linear and rotational offsets relative to the WorldOrigin. The Entity's own geometry (eg its angles) are relative to its EntityOrigin. The Entity's Position and Origin are in exactly the same point in space; and are almost the same thing. The only difference is which Frame of Reference you are looking at it from. When describing any geometric properties - vertices, angles, etc - it's very important to be clear which Frame of Reference we're referring to.

  • WorldOrigin : Often called the map origin, this is the worldspawn entity's position in the World (0,0,0). All World brushes are part of the worldspawn entity, so their vertex coordinates are relative to the WorldOrigin.
  • EntityOrigin : (also called a placementOrigin) defines the Entity's Location and Orientation in the World as well as its (default) Center of Rotation, Emission, etc. Brush entities which require a local origin use the origin keyvalue
    Confirm:or the "origin" tooltexture
    .
  • BoneOrigin : (parentbone) Each Studiomodel Bone is a reference point for the model's Attachments points, Vertex geometry, Animations, Joints, etc. Each bone is ultimately connected to the ModelOrigin via the Skeleton or bonetree hierarchy.


Ultimately all point-positions are translated up through the hierarchy into a location and orientation relative to the WorldOrigin. However, each Reference Frame may use a different mathematical method for recording a given Position. The most familiar will probably be the WorldOrigin's XYZ Map Grid Coordinates for location, and PYR (Pitch Yaw Roll) Angles for orientation. Leaving Euler rotations for a very rainy day, another common way of expressing orientation is a Normal Vector.

  • Generally, if a local origin for a Model or Brush is not specified, it is assumed to be the geometric center of the Bounding box.
  • lightingorigin :see info_lighting entity and $illumposition QC command.
  • Center of Mass $masscenter
  • Center of Rotation : By default, an object's local Origin is used as its center of rotation.
  • Center of Emission (particles, gibs, etc)