Camera Rotation using Quaternion

Hello guys.



I am new to the forum. A week ago i started to work with jme due to the fact that i have to build a 3d environment with some extra features for a class to show. :slight_smile:



I started to use the TestProjectedWater.java which presents an excelent and realistic form of waves. :-o



The only problem i have right now is that i want to rotate the camera. I can get the camera to rotate but now i can't move anymore in the world it is af if the input channels are frozen or someting.



The only thing i ded was adding this piece of code in the simpleUpdate method within the named java file.





        cam.setAxes(roll180.fromAngleAxis( FastMath.PI * slider.getPos()  / 180, new Vector3f(0,0,1) ));  
        cam.update();



Does anyone know why i can't move through the world?


Thanks in advance!


Regards

R

I remember one time I did that too… it seems that whenever you set any property of the camera that regards location and rotation… the firstpersonhandler that is innate in SimpleGame is being disabled… so I think you jave to re-configure by coding the FirstPersonHandler of the project you are working in…

mhelz0001 said:

I remember one time I did that too... it seems that whenever you set any property of the camera that regards location and rotation... the firstpersonhandler that is innate in SimpleGame is being disabled.... so I think you jave to re-configure by coding the FirstPersonHandler of the project you are working in...
'

I don't understand you quite well.

Could you maybe explain it again or mayby someone else who had this aswel or knows how to work around this problem?

Thanks in advance


R

ok… it seems that whenever you directly rotate the camera object using the setAxes(Quaternion n) function, the FirstPersonHandler innate to BaseSimpleGame is being disabled… so if you want to still have the innate FirstPersonHandler… you might want to use the functions cam.setLocation and cam.lookAt instead…

mhelz0001 said:

ok... it seems that whenever you directly rotate the camera object using the setAxes(Quaternion n) function, the FirstPersonHandler innate to BaseSimpleGame is being disabled.... so if you want to still have the innate FirstPersonHandler... you might want to use the functions cam.setLocation and cam.lookAt instead...


Thank you for explaining it again. I worked with the suggested functions but i can't get the camera to rotate.

Any other suggestions?

Thanks in advance.

R

As you can see i can rotate the camera with the slider but i can’t move through the world using my keyboard.