Translate
The Translate function moves the coordinate system origin to the point specified by (x, y, z).
Translate( x,y,z);
Arguments x, y, z
The x, y, and z coordinates of a translation vector.
Remarks
In an Actor Script, this has the effect of translating the actor by the vector [x,y,z]. It does not affect the position or orientation of other actors. Use this to position actors in the scene. Within the glDraw {...} protocol, you should use PushMatrix and PopMatrix as described below to leave the scene undisturbed. For example:
gldraw {
pushmatrix();
translate(5,0,0);
solidteapot(5);
popmatrix();
refresh();
}
The final refresh() is to remove the anonymous actor. The overall effect is to create a (temporary) teapot translated to [5,0,0] in the scene leaving the other actors fixed.
The current matrix (see MatrixMode) is multiplied by this translation matrix, with the product replacing the current matrix. That is, if M is the current matrix and T is the translation matrix, then M is replaced with M·T.
If the matrix mode is either GL_MODELVIEW or GL_PROJECTION, all objects drawn after Translate is called are translated. Use PushMatrix and PopMatrix to save and restore the untranslated coordinate system.
Note: Do not call Translate between a call to Begin and the corresponding call to End.
See Also