This article's documentation is for anything that uses the Source engine. Click here for more information.

$origin: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
 
(10 intermediate revisions by 8 users not shown)
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.
{{LanguageBar}}
{{tabsBar|main=gs|base=$origin}}
{{this is a|QC command|name=$origin}} It adjusts the position (and optionally Z rotation) of a model within its own local space. During compiling, 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]].
{{note|This command does not adjust positions of everything. It will adjust meshes, skeletons and [[$attachment]]s, but not anything else such as hitboxes ([[$hbox]]).}}
{{note|$origin does not work if the model uses [[$includemodel]].}}


== Syntax ==
== Syntax ==


[[Image:Cssorigins.GIF|right|This picture shows how origins are changed in the source engine.]]
$origin <x> <y> <-z> [z rotation]
 
Note that Z's value is reversed.


$origin (x) (y) (z) [z rotation]
== With viewmodels ==
[[File:Cssorigins.GIF|center]]


Refer to picture for axis manipulations.
== See also ==


[[Category:QC Commands|origin]]
* [[$autocenter]]
* [[Origin]]

Latest revision as of 21:55, 18 July 2025

English (en)Русский (ru)中文 (zh)Translate (Translate)

$origin is a QC command available in all Source Source games. It adjusts the position (and optionally Z rotation) of a model within its own local space. During compiling, 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).

Note.pngNote:This command does not adjust positions of everything. It will adjust meshes, skeletons and $attachments, but not anything else such as hitboxes ($hbox).
Note.pngNote:$origin does not work if the model uses $includemodel.

Syntax

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

Note that Z's value is reversed.

With viewmodels

Cssorigins.GIF

See also