Vizard 8 » Command Index » Vizard objects » node3d » <node3d>.setReferenceFrame
8.0

<node3d>.setReferenceFrame

Set the reference frame for node transformations

<node3d>.setReferenceFrame(  
mode  
)  
mode
One of the following reference frame modes:

Reference Frame

Description

viz.RF_PARENT

Transformations are relative to the parent node

viz.RF_VIEW

Transformations are relative to the view, before any stereo/view offsets are applied

viz.RF_EYE

Transformations are relative to the eye, after all stereo/view offsets are applied

viz.RF_GLOBAL

Transformations are relative to the global coordinate system

viz.RF_VIEW_POS

Transformations are relative to the view position, before any stereo/view offsets are applied. Useful for centering far away geometry (e.g. skydomes) around the view, but still being affected by view rotations.

viz.RF_EYE_POS

Transformations are relative to the eye position, after all stereo/view offsets are applied. Useful for centering far away geometry (e.g. skydomes) around the eye, but still being affected by eye rotations.

Remarks

This command controls the reference frame for all node transformations (i.e. position, rotation, and scale). viz.RF_VIEW and viz.RF_EYE can be used to have nodes that are fixed to the screen. The default reference frame is viz.RF_PARENT.

Return Value

None

Example

# Add ball fixed to the view
ball = viz.add('beachball.osgb',pos=(0,0,3))
ball.setReferenceFrame(viz.RF_VIEW)

See also

<node3d>.getReferenceFrame