TurnLeftTurnRight


TurnLeft/TurnRight

This command rotates the object left or right about the y-axis.

 object.TurnLeft(angle,time,animation,animation speed) 

or:

 object.TurnRight(angle,time,animation,animation speed) 

Parameters

angle

The number of radians to move left or right

Time

The number of seconds that the move will take (if omitted, the movement is immediate)

Animation

The animation name to play (only for 3D objects)

Animation speed

The speed of the animation from 0 to 100

Sample Code

The following code will turn the sphere left 2 radians in 5 seconds. The sphere is facing forward, so the lines on the sphere that you can see appear to rotate right.

 oworld = New World(); ocamera = New Camera(oworld); sphere = oworld.CreateSphere(50,50,50,25,25); ocamera.MoveBack(1200); ocamera.Walk(); sphere.TurnLeft(2,5); //Move it in 5 seconds. //Loop While(TRUE); 



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

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net