Can someone help me with some simple code to rotate a node around the x axis 45 degrees and the stop every time the user presses x.
as opposed to this:
if IsKeyDown(EKEY_CODE.KEY_KEY_X) = true then
KeyIsDown(EKEY_CODE.KEY_KEY_X) = false
x=1
// add rotation animator
dim position as core_vector3df = new core_vector3df(0,0,0)
position = new core_vector3df(x,y,z)
anim = scene.createRotationAnimator(position)
node.addAnimator(anim)
end
Thanks
if IsKeyDown(EKEY_CODE.KEY_KEY_X) = true then
KeyIsDown(EKEY_CODE.KEY_KEY_X) = false
x = x +45
// add rotation animator
dim position as core_vector3df = new core_vector3df(x,y,z)
position = new core_vector3df(x,y,z)
node.setRotation( position )
node.updateAbsolutePosition()
if x =360 then x=0
end
Thank You!
This node jumps to the next position. Is there an easy way to see it rotate the 45 degrees ? I am working on a variation of the rubik's cube.