saving and seting camera position

Started by eye1, March 22, 2007, 02:19:36 PM

Previous topic - Next topic

eye1

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?

Melssj5

Well, you must use a Rotation Matrix, there is a post about this. let me find it.
Nada por ahora

eye1


raft

this should do the trick:

Camera.setBack(direction.getRotationMatrix().invert3x3());

EgonOlsen

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.