www.jpct.net
jPCT - a 3d engine for Java => Support => Topic started by: eye1 on March 22, 2007, 02:19:36 pm
-
I would like to do this:
At some point I would like to save current camera position and direction. Which i do with getPosition() and getDirection().
I save those numbers to file
Than at some point I would like to retrieve those number and set camera to saved position and direction.
I use setPosition().. but can't find the method setDirection()??
Is there a way i can save the direction and then retrieve it again?
-
Well, you must use a Rotation Matrix, there is a post about this. let me find it.
-
I will be glad if you do :)
-
this should do the trick:
Camera.setBack(direction.getRotationMatrix().invert3x3());
-
Either that, or store the result of Camera.getBack() in new Matrix and set that when needed. Depends if you want to store direction only or the matrix itself.
-
thank you... :)