Author Topic: saving and seting camera position  (Read 5351 times)

Offline eye1

  • int
  • **
  • Posts: 68
    • View Profile
saving and seting camera position
« 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?
 

Offline Melssj5

  • double
  • *****
  • Posts: 724
    • View Profile
Re: saving and seting camera position
« Reply #1 on: March 22, 2007, 02:51:04 pm »
Well, you must use a Rotation Matrix, there is a post about this. let me find it.
Nada por ahora

Offline eye1

  • int
  • **
  • Posts: 68
    • View Profile
Re: saving and seting camera position
« Reply #2 on: March 22, 2007, 03:11:58 pm »
I will be glad if you do   :)

Offline raft

  • quad
  • ******
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: saving and seting camera position
« Reply #3 on: March 22, 2007, 05:11:17 pm »
this should do the trick:

Code: [Select]
Camera.setBack(direction.getRotationMatrix().invert3x3());

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: saving and seting camera position
« Reply #4 on: March 22, 2007, 05:44:14 pm »
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.

Offline eye1

  • int
  • **
  • Posts: 68
    • View Profile
Re: saving and seting camera position
« Reply #5 on: March 23, 2007, 01:36:25 am »
thank you...  :)