I apoligize if this has been answered before (I have searched though) but I've run into some problems with EZRotate.
In the code Snippet Below I wanted a ship to rotate towards a certain angle (rotate 90 degrees to the left to roll etc) when a key is pressed, I encountered a few problems with DarkBasics Eular angles as it caused the ship to rotate in very awkward angles when X, Y and Z rotations where mixed.
I went ahead and used EZrotate which has Global Roatation, unfortunately the command to rotate doesn't seem to allow me to rotate towards a specific angle and insted(as shown below) causes the ship to rotate constantly
EZro_Set OBJECT ANGLE X(1),OBJECT ANGLE Y(1),OBJECT ANGLE Z(1)
if inkey$()="s"
Zrotation#=curvevalue(-90,Zrotation#,50)
else
if inkey$()="a"
Zrotation#=curvevalue(90,Zrotation#,50)
else
Zrotation#=curvevalue(0,Zrotation#,50)
endif
endif
if downkey()=1
Xrotation#=curvevalue(-40,Xrotation#,50)
move object up 3,2
else
if upkey()
move object down 3,2
Xrotation#=curvevalue(40,Xrotation#,50)
else
Xrotation#=curvevalue(0,Xrotation#,50)
endif
endif
if leftkey()
move object left 3,2
Yrotation#=curvevalue(-40,Yrotation#,50)
else
if rightkey()
move object right 3,2
Yrotation#=curvevalue(40,Yrotation#,50)
else
yrotation#=curvevalue(0,Yrotation#,50)
endif
endif
EZro_GX Xrotation#
EZro_GY Yrotation#
EZro_GZ wrapvalue(Zrotation#)+wrapvalue(sin(number#)*times)
ROTATE OBJECT 1,EZro_GetX(),EZro_GetY(),EZro_GetZ()
Long Story short:
Is it possible with EZRotate-Basic to rotate on the global axis to a specific angle?
i.e make EZrotate behave like this:
but on the global axis?
Thank you in advance for assistance