This command sets the position and angle of a 3D object.



x , y , and z

The object s position on the x, y, and z coordinate system

anglex , angley , and anglez

Refer to the position of the object relative to the x, y, or z axes in radians.

t ime

The number of seconds the command requires.


Alternately, we can make the position of the object the same as another 3D object, as shown here:

 object.Set(other3DObject, time) 

Sample Code

 oworld = New World(); ocamera = New Camera(oworld); obrick = oworld.CreateBrick(50,50,50); ocamera.MoveBack(1200); // Set the position of the brick. It will be moved // and rotated about all three axes in 5 seconds. Obrick.Set(50,50,30,1,0.5,0.25,5); //lLop While(TRUE)  {   //Roll left when the left arrow key is pressed.   If(IsKeyDown(Keyboard.LEFT))    {     obrick.RollLeft(1,1);    }   // Roll right when the right arrow key is pressed.    If(IsKeyDown(Keyboard.RIGHT))    {     Obrick.RollRight(1,1);    }   } 

Elementary Game Programming and Simulators Using Jamagic
Elementary Game Programming & Simulations Using Jamagic (Charles River Media Game Development)
ISBN: 1584502614
EAN: 2147483647
Year: 2002
Pages: 105
Authors: Sergio Perez © 2008-2017.
If you may any questions please contact us: