Author Topic: how to create animation, camera move rotate or....?  (Read 2361 times)

Offline hamedf_hamedf

  • byte
  • *
  • Posts: 19
    • View Profile
how to create animation, camera move rotate or....?
« on: December 05, 2012, 04:08:45 pm »
 Dear All,
i created a scene like my room in 3dmax and load it.
i want to make an animation that camera is moving around my room and rotate.
but i don't know how to create it, even i don't know is there anything like timer in java.
i read something about keyframe but i do'nt understand it good.

Thanks

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: how to create animation, camera move rotate or....?
« Reply #1 on: December 05, 2012, 11:45:07 pm »
You have to code the camera path yourself somehow. How, it up to you. For example, you can define some base points that set the path and interpolate the camera's position between them. Simple timing can be based on System.currentTimeMillis and System.nanoTime.

Offline hamedf_hamedf

  • byte
  • *
  • Posts: 19
    • View Profile
Re: how to create animation, camera move rotate or....?
« Reply #2 on: December 06, 2012, 06:49:16 am »
Dear Egon,
ok, i create the path myself, but
where do i use that timers? which event?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: how to create animation, camera move rotate or....?
« Reply #3 on: December 06, 2012, 07:17:32 am »
No event. It's about measuring the time that the last frame took and adjust your movement accordingly. Google for "game loop java" or take a look here: http://www.java-gaming.org/index.php/topic,24220.0. On Android, there is no loop. The onDrawFrame-method actually is a kind of timer, but the logic of measuring time and adjusting your animation still applies.