$origin: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
(redone; the details about flipping axes with left-handed models are too specific for this article)
Line 1: Line 1:
The [[$origin]] [[QC command]] is used to ''offset'' the [[ModelOrigin]] from the [[EntityOrigin]]. It shifts all the vertices and animations to the specified location. Also allows an optional z-axis rotation.
The [[QC command]] '''<code>$origin</code>''' adjusts the position of a model within its own local space. When the model is created, it will be offset by the X, Y, -Z and Z-rotation values provided.


* It is very useful for adjusting [[Viewmodel|view models]].
This is useful when adjusting [[Viewmodel|view models]], for ensuring that models don't spawn inside the world, and helping in the arranging of clusters of separate models that need to be aligned precisely with each other (e.g. parts of a building).
* It is also useful for arranging a versatile cluster of separate models such as an entire building consisting of exterior_walls.mdl, roof.mdl, interior_walls.mdl, roof_details.mdl, etc
* See also [[$autocenter]], [[$illumposition]], [[$masscenter]].


== Syntax ==
== Syntax ==


[[Image:Cssorigins.GIF|right|This picture shows how origins are changed in the source engine.]]
$origin <x> <y> <-z> [z rotation]


$origin (x) (y) (z) [z rotation]
Note that Z's value is reversed.


Refer to picture for axis manipulations.
== See also ==
 
* [[$autocenter]]
* [[Origin]]


[[Category:QC Commands|origin]]
[[Category:QC Commands|origin]]

Revision as of 05:06, 9 January 2009

The QC command $origin adjusts the position of a model within its own local space. When the model is created, it will be offset by the X, Y, -Z and Z-rotation values provided.

This is useful when adjusting view models, for ensuring that models don't spawn inside the world, and helping in the arranging of clusters of separate models that need to be aligned precisely with each other (e.g. parts of a building).

Syntax

$origin <x> <y> <-z> [z rotation]

Note that Z's value is reversed.

See also