Camera
- Last UpdatedOct 22, 2025
- 7 minute read
The Camera node links a camera in the scene with a logical interface. The camera node is a complex node because it supports many different behaviors. Each behavior is characterized by a different set of fields.
You can move the camera and read/write its parameters.
Platform support
This node is fully supported on XR-Windows platform.
It is partially supported on XR-Portable Windows, XR-Portable iOS, XR-Portable Android, and XR-P WASM platforms.
The portable platforms do not support Avatar mode and debug mode.
|
XR-WIN |
XR-P-WIN |
XR-P-IOS |
XR-P-AND |
XR-P-WASM |
|---|---|---|---|---|
|
Full support |
Partial support |
Partial support |
Partial support |
Partial support |
|
|
|
|
|
|
Code example
This is a code example for the Camera node.
<Camera name="cam" clone="Camera01" type="avatar" near="0.3" />
Position
The Camera node must be inside a context node, such as Context or Global.
Creating a Camera
A camera is purely a logic node. A corresponding camera object is not required in the scene MWXs. When creating a camera in the XR Studio Graphic Context Editor, the new camera is placed into the current visualized position with the current XR Studio camera settings.
Although not required, you can include camera objects in the MWX exported data. There are several ways to relate logic cameras to exported ones.
Linking exported camera
If you set the camera field to an exported camera name, the logic camera is linked to the exported camera.
This can be useful to manage camera path movements, in two ways:
-
Using camera type.
-
Using/target type with follow set to true.
Copying settings from exported camera
Use the setFromCamera field to copy the camera settings (such as Position, Target, Far, Near, Fov) from an exported camera. This does not create a link and the copy happens only when the event triggers.
If the setFromCamera field is populated at node definition level, it aligns camera initial settings to exported content. Therefore, any modification done in the export is reflected.
Depth of Field
Engine cameras supports depth of field. This means that objects may appear focused or blurred according to their distance from the camera.
Enable Depth of Field
-
Enable Depth of Field inside HDR.
-
Set the dofEnabled setting of a camera to true.
-
Use dofFocalDistance and dofFocalDepth to change the camera focus.

Stereo and convergence
The 3D rendering output can be stereo or mono, because the engine supports different types of stereo outputs (see config.xml).
In addition to the camera convergenceType, the stereo visual output depends on two parameters:
-
Eye separation
-
Eye convergence
Eye convergence and separation values are not set inside a single camera but are common, so they can be found in the global node.
Convergence types
There are three states for convergenceType.
|
State |
Description |
|---|---|
|
parallel |
No convergence, parallel view. |
|
off Axis |
At convergence distance, the two projection planes coincide (distorted projection planes). |
|
toe in |
At convergence distance, the center of the frustum coincides. |

Projection mode
The camera supports an ortho projection mode, in addition to the perspective projection mode.
You can change the projection mode at any time with the projectionMode parameter.
Ortho projection mode
-
When the camera is ortho mode, there is no field of view angle because there is no perspective.
-
Use the orthoWidth parameter to define what is shown in the camera according to its position and orientation This parameter expresses the camera ortho projection width in meters.
-
Changing the orthoWidth in ortho mode results in a zoom effect because the same screen area shows a smaller width of contents.
Simple matrix type
When camera type is set to matrix, the camera can be moved and rotated by assigning the transformation matrix to the matrix field. Only the matrix field is responsible for the camera posture, while position and target fields are used as read-only fields that constantly reflect the camera current transformation.
Note: Writing the position or target fields on a camera of type matrix has no effect on the actual camera posture, and those fields will start to reflect the correct values again only when the matrix field is set again.
Camera fields
These are the fields for Camera node. Only the node-specific fields are indicated, not fields obtained by inheritance.
Field inheritance: NodeBase > Camera
|
Fields |
Type |
Use |
Default value |
Description |
|---|---|---|---|---|
|
camera |
sstring |
Mandatory |
Not set |
Can be set to an exported camera name and creates a link to it. Name must be unique. |
|
cameraData |
mdouble |
Optional |
Not set |
Camera data is automatically generated in all camera types except remote. In remote, it is used as input to reproduce another camera behavior. Camera data serialization: position.x, position.y, position.z, target.x, target.y, target.z, fov, trackerPosition.x, trackerPosition.y, trackerPosition.z, trackerOrientation.x, trackerOrientation.y, trackerOrientation.z. |
|
caveEnable |
sbool |
Optional |
false |
Enables cave projection calculation. Note that Viewport cave fields would conflict with the camera cave logic. It is recommended to use the Viewport cave instead. |
|
cavePoints |
mvec3 |
Optional |
-1.75 -1.3 1.75,1.75 -1.3f 1.75,-1.75 1.3 1.75 |
Cave screen top-left, top-right and bottom-left coordinates in meters referred to cave center. Note that Viewport cave fields would conflict with the camera cave logic. It is recommended to use the Viewport cave instead. |
|
convergenceType |
senum |
Optional |
Parallel |
Selects the convergence mode to use in stereo. |
|
dofEnable |
sbool |
Optional |
false |
Enables Depth of Field (DOF) for the camera. |
|
dofFocalDepth |
sfloat |
Optional |
1 |
Length in meters of the focused area centered in dofFocalDistance |
|
dofFocalDistance |
sfloat |
Optional |
1 |
At which distance from camera is set the focused area center. |
|
far |
sfloat |
Optional |
Default camera far |
Allows the setting of the camera far clipping plane. |
|
fixedUp |
sbool |
Optional |
true |
Set to false to have free camera. Otherwise the up axis is fixed and the camera can be rotated only on a plane (no roll). |
|
follow |
sbool |
Optional |
false |
If camera field is set to an exported camera and cameraType is Target, setting to true forces the camera to follow the exported one. |
|
fov |
sfloat |
Optional |
Default camera fov |
Allows the setting of the camera field of view. |
|
jumpAbsoluteTarget |
sbool |
Optional |
true |
|
|
jumpTime |
sfloat |
Optional |
1 |
Used to set the interpolation time. |
|
jumpTo |
sstring |
Optional |
Not set |
Use this field to set camera position interpolation. The value must match the name of one or more placeholder cameras (space separated). |
|
jumpToFinished |
sevent |
Optional |
Not set |
Called when the jump interpolation is finished. |
|
jumpType |
sstring |
Optional |
Linear |
Currently only linear interpolation is supported. So must be remain as is. |
|
matrix |
smatrix |
Optional |
1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 |
Used when type is matrix to apply a transformation matrix to the camera. Matrix translation and rotation are applied to the camera. Target position will be calculated as the addition of translation and forward vector. This means that matrix scale has an impact on the distance of the calculated target. |
|
near |
sfloat |
Optional |
Default camera near |
Allows the setting of the camera near clipping plane. |
|
orientation |
svec2 |
Optional |
Not set |
Alternative to target. When set updates the target, it is not updated by the target change. The three elements of the vector are yaw, pitch, and roll. The values are in radiants. |
|
orthoWidth |
sfloat |
Optional |
100 |
Width in meters of the ortho projection on the screen. |
|
overrideFar |
||||
|
overrideFov |
||||
|
overrideNear |
||||
|
pitch |
sfloat |
Optional |
Not set |
This can be used to rotate the camera against the X axis. Accepts radiants values. Attention pitch is always done after yaw. |
|
pitchYawPosition |
sbool |
Optional |
Not set |
It is the offset required to move around a target with a camera when usePitchYawPosition. When moving the target the same offset should be added to this field to maintain the relative yaw pitch and zoom. |
|
position |
svec3 |
Optional |
Initial camera position |
This field can be used to read and write the camera position. |
|
projectionMode |
senum |
Optional |
Perspective |
Switch between perspective and ortho projection modes. |
|
roll |
sfloat |
Optional |
Not set |
This can be used to rotate the camera against the z axis. Accepts radiants values. Attention roll is always done after pitch. Considered only if fixedUp is not set to true. |
|
setFromCamera |
sstring |
Optional |
Not set |
When set to an exported camera name overrides current camera settings with the one found in the exported one. It does not create a link. The camera node name must be different from the MWX camera name. |
|
showCommand |
sevent |
Optional |
Not set |
Invoke it to display the camera output. Initial camera is defined into global node. |
|
target |
svec3 |
Optional |
Initial camera target |
This field can be used to read and write camera target. |
|
trackerOrientation |
svec3 |
Optional |
0 0 0 |
Tracker orientation offset to be used according to selected trackerOrientationMode. |
|
trackerOrientationMode |
senum |
Optional |
None |
Select among none, add and override modes. |
|
trackerPosition |
svec3 |
Optional |
0 0 0 |
Tracker position offset to be used according to selected trackerPositionMode. |
|
trackerPositionHead |
sfloat |
Optional |
0 |
Center head-to-eye distance to be used for trackers positioned on glasses. |
|
trackerPositionMode |
senum |
Optional |
None |
Select among none, xz, relative, and add modes. |
|
type |
senum |
Optional |
Target |
These are the camera types: -avatar; -camera; -target -remote, -matrix. |
|
usePitchYawPosition |
sbool |
Optional |
false |
Set to true to implement a target camera type that moves around the target using pitch, yaw and zoom. |
|
yaw |
sfloat |
Optional |
Not set |
This can be used to rotate the camera against the Y axis. Accepts radiants values. |
|
zoom |
sfloat |
Optional |
0 |
In target type allow to move camera near/far to target moving on the conjunction vector. The range is (-1 1) both not included. |