Vizard 8 » Tutorials & Examples » 3D models » Coordinate Systems » Tutorial: Transform Modes
8.1

Tutorial: Transform Modes

Key Concepts
Explanation

Let's add a crate to the world coordinate system for the two smaller pigeon's to perch on:

crate = viz.addChild('crate.osgb',pos=[-1,0.25,2], scale=[0.5,0.5,0.5])

The original dimensions of the crate are 1 meter on each side. After scaling it down by a factor of two and positioning it to rest the ground, it's top side is at a height is 0.5 meters. For the pigeons to perch there they will have to be near the X,Y,Z point [-1,0.5,2].

 

To move childPigeon to this location in world coordinates we'll use the viz.ABS_GLOBAL flag. If we don't use this flag he will be placed in mamaPigeon's coordinate system far away from the crate. Since worldPigeon is a child of the world, the flag is not necessary. Add the following code to place the pigeons on top of the crate:

childPigeon.setPosition([-1,0.5,2.15], viz.ABS_GLOBAL)
worldPigeon.setPosition([-1,0.5,1.85])

Since we didn't change the orientation of childPigeon, he's still facing +Z in mamaPigeon's local coordinate system:

Different Coordinate Systems

Node Parents

Querying Position

Transform Modes

Relative Position Change