Rotate ChaseCam on z axis

Hi there,

I have a spaceship game that i’m currently developing and I’m trying to rotate the camera on the Z axis. I know you can rotate on the X and Y axis using ‘setDefaultHorozontalRotation’ and ‘setDefaultVerticalRotation’, but I really need to rotate on the Z axis because I want to be able to make my spaceship roll around realistically; is there any way to do this?

Thanks in advance,
Luke

It probably doesn’t let u do that. Because once you’ve got roll, all your rotations start getting screwed.

You’d think rotations would be worked out from a root node, not from the camera. Is there any way I can attach another type of camera to view from and then do roll on that camera instead?

I guess you will need to take some vector math and modify the chasecam.

Here is my version of the chasecam. I removed limitations of the rotation.
http://code.google.com/p/jme-simple-examples/source/browse/JMESimpleExamples/src/com/simpleEditor/EditorChaseCamera.java
But for z rotation you will need heavily modify the chase camera too. To bind it for a different key for instance…

Also you can check this project. It has z rotation on the last video. http://hub.jmonkeyengine.org/forum/topic/jmeplanet/

Okay, I’ll have a look after I get home from work, thank you both for your help so far! :slight_smile: