This command increases the angle of the object relative to the world axis. It changes the angle immediately or at a speed that you can specify.
object.AddAngle(xangle, yangle, zangle, time)
xangle | Number of radians to add about the x-axis |
yangle : | Number of radians to add about the y-axis |
zangle | Number of radians to add about the z-axis |
time | Number of seconds for rotation |
There is another way to express this function. You might say,
object.AddAngle(another3DObject, time),
where another3DObject refers to another object from which to add the angle.
It is important to know that there is a difference between the SetRelativeAngle command and the AddAngle command. The AddAngle command moves the object about the stationary world axes. The SetRelativeAngle command moves the object about its own x, y, and z axes. Please consult the explanation for the SetRelativeAngle command later in this appendix to see sample code that allows you to see the differences between the two commands. The same applies to the SetAngle command, which is also made in reference to the world axes.
You should also realize that you do not really need the SubAngle command, which turns the object in the opposite directions: the AddAngle command will do the same motion if you use negative numbers .
oworld = New World(); ocamera = New Camera(oworld); sphere = oworld.CreateSphere(50,50,50,25,25); ocamera.MoveBack(1200); ocamera.Walk(); sphere.AddAngle(1,2,3,5); //rotates it in 5 seconds //Loop While(TRUE);