As dark coder already explained, it is due to Euler angles. Under this rotation method, you can get the same angle, with different x,y & z values, when taken as a whole. For example a rotation of (0,270,0) is the same as rotating at (180,-90,180).
sync on
sync rate 60
phy start
autocam off
position camera -20,20,-25
point camera 0,10,0
make light 1
set directional light 1, -5,-5,5
make object box 1,4000,1,4000
Color object 1, rgb ( rnd ( 0 ), rnd ( 0 ), rnd ( 255 ) )
phy make rigid body static box 1
make object box 2,8,5,5
position object 2,-12,3,0
phy make rigid body dynamic box 2
phy set rigid body kinematic 2, 2
make object box 3,8,5,5
position object 3,0,3,-5
phy make rigid body dynamic box 3
phy set rigid body kinematic 3, 2
phy set dynamic friction 0.1
phy set static friction 0.1
ang# = 0
do
set cursor 0,0
print "Angle Set: "
print angx#
print ang#
print angz#
print ""
print "Object Angle: "
print object angle x(2)
print object angle y(2)
print object angle z(2)
if leftkey()
ang# = ang# + 1.0
endif
if rightkey()
ang# = ang# - 1.0
endif
ang# = wrapvalue(ang#)
phy set rigid body kinematic rotation 2, angx#, ang#, angz#
phy update
` Rotating using Euler Angle
phy set rigid body kinematic rotation 3, object angle x(2), object angle y(2), object angle z(2)
sync
loop
Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why.
Programmers combine theory and practice: Nothing works and they don't know why.