# Celestia/Celx Scripting/CELX Lua Methods/CEL command setorientation
### setorientation

setorientation { angle <anglenumber> axis <axisvector> }
-- OR --
setorientation { ow <ownumber> ox <oxnumber> oy <oynumber> oz <oznumber> }
Sets the camera orientation. If you are attempting to duplicate a position based on a Bookmark or Cel://URL, you will also need to set the proper Coordinate System, position, and other parameters.
Arguments:

#### angle <anglenumber>

    Angle in degrees. No default. This value may be obtained from a Celestia Bookmark, which is stored in the favorites.cel located in the Celestia directory.

#### axis <axisvector>

    Rotation vector [ <xrot> <yrot> <zrot> ], no default. This value may be obtained from a Celestia Bookmark, which is stored in the favorites.cel file located in the Celestia directory. <xrot>, <yrot> and <zrot> are the Eular Angle or Angle-Axis representation of the camera's orientation. Think of them as Pitch, Yaw, and Roll in aviation.
-- OR --
Arguments:

#### ow <ownumber>

    represents the angle as stored by a Cel://URL. It is obtained from the following Cel://URL value: &ow. No default.

#### ox <oxnumber>

    represents the x-axis as stored by a Cel://URL. It is obtained from the following Cel://URL value: &ox=. No default.

#### oy <oynumber>

    represents the y-axis as stored by a Cel://URL. It is obtained from the following Cel://URL value: &oy=. No default.

#### oz <oznumber>

    represents the z-axis as stored by a Cel://URL. It is obtained from the following Cel://URL values: &oz=. No default.
CELX equivalent-1:
Based on Parameter list-1 and the celestia:newvector, celestia:newrotation(axis-angle) and observer:setorientation methods.
* Create new vector, containing the axis of this rotation [ <xrot> , <yrot> , <zrot> ], and store in "vec".
* Convert the <anglenumber> from degrees in radians and store in "angle": "angle" = math.pi / 180 * <anglenumber> (= 3.14159265 / 180 * <anglenumber> ). The Lua math.rad( <anglenumber> ) function can also be used for this.
* Create new rotation (i.e. a quaternion) of an "angle" about the specified axis of this rotation in "vec", and store in "rot".
* Get observer instance of the active view and rotate the observer according the created new rotation in "rot".
Summarized:
CELX equivalent-2:
Based on Parameter list-2 and the celestia:newrotation and observer:setorientation methods.
* Create new rotation (i.e. a quaternion) from four scalar values and store in rot. <ownumber>: The OW-component of the new rotation, as a number-values taken from a cel-style URL &ow=. <oxnumber>: The OX-component of the new rotation, as a number-values taken from a cel-style URL &ox=. <oynumber>: The OY-component of the new rotation, as a number-values taken from a cel-style URL &oy=. <oznumber>: The OZ-component of the new rotation, as a number-values taken from a cel-style URL &oz=.
* Get observer instance of the active view and rotate the observer according the created new rotation in "rot".
Summarized:
Example: Set the camera orientation according parameterlist-1:
CEL:
CELX based on parameter list-1:
Example: Set the camera orientation according parameterlist-2:
CEL
CELX based on parameter list-2:
Back to CEL command index