Now forgive for being soo stupid...
OK imagine a cube and you rotate it on the x axis so that its pointing almost straight up...
rotateentity cube,-85,0,0,0
Now image wanting to 'look' left right based upon the cubes local y axis (which is now effectively running almost thru the screen (on the global z axis). So you do this...
rotateentity cube, 0,45,0,0
rotateentity cube, 0,-45,0,0
Now the problem is it doesn't turn along its local y axis, i.e. the y axis has not been 'transformed' by the original x axis rotate. Have can I achieve this?
So turn the cube to face almost up (down arrow) then look left right using right left cursor keys. The cubes axis is always up down. How can I 'translate' it's axis so that it's not fixed to the global axis.
Hope this makes sence.
OK imagine a cube and you rotate it on the x axis so that its pointing almost straight up...
rotateentity cube,-85,0,0,0
Now image wanting to 'look' left right based upon the cubes local y axis (which is now effectively running almost thru the screen (on the global z axis). So you do this...
rotateentity cube, 0,45,0,0
rotateentity cube, 0,-45,0,0
Now the problem is it doesn't turn along its local y axis, i.e. the y axis has not been 'transformed' by the original x axis rotate. Have can I achieve this?
; RotateEntity Example ; -------------------- Graphics3D 640,480 SetBuffer BackBuffer() camera=CreateCamera() light=CreateLight() cone=CreateCube() PositionEntity cone,0,0,5 While Not KeyDown( 1 ) ; Change rotation values depending on the key pressed If KeyDown( 208 )=True Then pitch#=pitch#-1 If KeyDown( 200 )=True Then pitch#=pitch#+1 If KeyDown( 203 )=True Then yaw#=yaw#-1 If KeyDown( 205 )=True Then yaw#=yaw#+1 If KeyDown( 45 )=True Then roll#=roll#-1 If KeyDown( 44 )=True Then roll#=roll#+1 ; Rotate cone using rotation values RotateEntity cone,pitch#,yaw#,roll#,1 RenderWorld Text 0,0,"Use cursor/Z/X keys to change cone rotation" Text 0,20,"Pitch: "+pitch# Text 0,40,"Yaw : "+yaw# Text 0,60,"Roll : "+roll# Flip Wend End
So turn the cube to face almost up (down arrow) then look left right using right left cursor keys. The cubes axis is always up down. How can I 'translate' it's axis so that it's not fixed to the global axis.
Hope this makes sence.