DarkBASIC Professional Help Wiki
Advertisement


This command will reverse the camera rotation order.

Syntax
SET CAMERA ROTATION XYZ
SET CAMERA ROTATION XYZ Camera Number
Parameters
Camera Number

Integer
The camera number

Returns

This command does not return a value.

Description

The cameras normal rotation order is to first rotate on the Z axis, then on the Y axis and finally on the X axis. This command reverses this order to XYZ.

Example Code
autocam on

make matrix 1,4000,4000,100,100

set matrix height 1,50,50,500

update matrix 1

while mouseclick()<>1

set cursor 0,0

print "USE ARROW KEYS TO MOVE / A+Z XRotate / S+X ZRotate"

print "SPACE/RETURN To Toggle Rotation Order"

if upkey()=1 then move camera 0,5.0

if downkey()=1 then move camera 0,-5.0

if leftkey()=1 then y#=y#-1

if rightkey()=1 then y#=y#+1

if inkey$()="a" then x#=x#-1

if inkey$()="z" then x#=x#+1

if inkey$()="s" then z#=z#-1

if inkey$()="x" then z#=z#+1

if spacekey()=1 then set camera rotation zyx 0

if returnkey()=1 then set camera rotation xyz 0

xrotate camera 0,x#:yrotate camera 0,y#:zrotate camera 0,z#

endwhile

while mouseclick()=1 : endwhile

delete matrix 1

autocam off

end
Advertisement