FANDOM



This command will rotate an existing 3D object to roll left.

Syntax
ROLL OBJECT LEFT Object Number, Value
Parameters
Object Number

Integer
The object number Value Float
The value of the angle can be positive or negative

Returns

This command does not return a value.

Description

The rotation is independent of any axis orientation and allows free motion. The value of the angle can be positive or negative. The object number must be specified using an integer value. The angle must be specified using a real value. Be aware that you cannot use EULER ANGLES in combination with this command. Euler angles are accessed with the ROTATE OBJECT command, whereas Freeflight commands are accessed with the TURN, PITCH and ROLL commands.

Example Code
sync on : sync rate 0 : hide mouse:cls 0

ObjectNumber=1

SecondObject=2

load object "model.x",ObjectNumber

load object "model.x",SecondObject

rotate object ObjectNumber, 270, 0, 0

fix object pivot ObjectNumber

point object ObjectNumber,0,0,0

position object ObjectNumber, 0,0,0

while mouseclick()=0

if spacekey()=1 then move object ObjectNumber,1

if leftkey()=1 then turn object left ObjectNumber,1

if rightkey()=1 then turn object right ObjectNumber,1

if upkey()=1 then pitch object up ObjectNumber,1

if downkey()=1 then pitch object down ObjectNumber,1

if inkey$()="," then roll object left ObjectNumber,1

if inkey$()="." then roll object right ObjectNumber,1

sync

endwhile

delete object ObjectNumber

delete object SecondObject

end