how to create animation, camera move rotate or....?

Started by hamedf_hamedf, December 05, 2012, 04:08:45 PM

Previous topic - Next topic

hamedf_hamedf

 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

EgonOlsen

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.

hamedf_hamedf

Dear Egon,
ok, i create the path myself, but
where do i use that timers? which event?

EgonOlsen

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.