@Paul Johnston -no, the object quat line cures my test program only when you first meet the 90th degree. Then you notice the floats stick on 90 while the quat value still increases. Then when the floats move again if you revisit the 90th degree you`ll find the error has returned unabated.
I had seen quaternion commands but had yet to learn about them so was just using simple rotate commands. Can someone tell me what they are or give a simple rotation program based on them? What for example is `w` the fourth vector???
I see euler rotation is also supported, that`s four ways to think of a simple rotation. Ok I know that matrixised rotations are far from simple and all that...but global/local/quaternion or euler sounds problematic.
In dbPro I had ezrotate so there it was euler rotations which I forgave for the simpler rotate xyz commands, but never noticed an error. Well perhaps it was the cause for things misreporting their positions when the camera got too far away from 0,0,0 but I`ll never know as dbpro no longer works in my Win8.1 environment. But could a working quaternion representation be made to multiply or even wrap(360) to the rotate command? A wrap var command would be handy here for these kinds of maths from an AppGameKit perspective? Complex topic it seems, rotation and transformation.
So like this below there is still a misplacing of the initial rotate object 90 call but 1st visit to 90 it seems to work and reports 90, then when you move the floats away and return a second time to 90 degrees the error has returned, plus the quat increases but the rotation does not momentarily. The euler commands arent funtional yet so rem`ed out and I don`t know how to translate a quat to a 360 rotation yet:-
SetClearColor(0,0, 50 )
pitch# as float
pitch#=0
CreateLightDirectional( 1, 10,10,10, 200, 200, 250 )
SetLightDirectionalDirection( 1, -1, -1,-1 )
CreateLightPoint( 2, 25,25, 25, 100, 255, 255, 80 )
createobjectsphere(1,10,10,10)
SetObjectPosition( 1, 1417,2017,2267 )
SetObjectLightMode( 1, 1 )
SetObjectCollisionMode( 1, 0 )
rotateobjectlocalx(1,90)
do
if GetRawKeyState( 87 )=1
pitch#=pitch#+0.001
rotateobjectlocalx(1,pitch#)
`setobjectrotationquat(1,0,pitch#,0,0)```not as simple as this
`setObjectEulerX(pitch#)````not yet functioning
else
pitch#=0
endif
if GetRawKeyState( 83 )=1
pitch#=pitch#-0.001
rotateobjectlocalx(1,pitch#)
else
pitch#=0
endif
setcamerarotationquat(1,getobjectquatw(1),getobjectquatx(1),getobjectquaty(1),getobjectquatz(1))
`setcamerarotation(1,getobjectanglex(1),getobjectangley(1),getobjectanglez(1))
SetcameraPosition(1,getobjectx(1),getobjecty(1),getobjectz(1))
movecameralocalz(1,-22)
Print("Press W(+) and S(-) to rotate the sphere+camera")
Print("ObjectAngX="+str(getobjectanglex(1)))
Print("ObjectQuatX="+str(getobjectquatx(1)))
Print("CamQuatX="+str(getcameraquatx(1)))
Print("CamX="+str(getcameraanglex(1)))
`Print("EulerX"+str(GetObjectEulerX(1))) `not yet functional
Sync()
loop
Working quat rotation examples greatly appreciated