This command decreases the angle of the object relative to the world axis. It changes the angle immediately or at a speed that you can specify.
object.SubAngle(xangle, yangle, zangle, time)
xangle, yangle, zangle
Refer to the number of radians to subtract from the object s orientation about each axis.
Refers to the number of seconds for which the rotation is to take place.
Alternately, you can say:
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 and SubAngle commands. The SubAngle command moves the object about the stationary world axes. The SetRelativeAngle moves the object about its own x, y, and z axes. Please consult the explanation for the SetRelativeAngle command to see sample code that allows you to see the differences between the SetRelativeAngle and the SubAngle commands.
You should also realize that you do not really need the SubAngle command ”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.SubAngle(1,2,3,5); //Rotates it in 5 seconds. //Rotate it in the opposite direction. //sphere.SubAngle(-1,-2,-3,5); //Rotates it in 5 seconds. //Loop While(TRUE);