www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: hamedf_hamedf on December 05, 2012, 04:08:45 pm

Title: how to create animation, camera move rotate or....?
Post by: hamedf_hamedf 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
Title: Re: how to create animation, camera move rotate or....?
Post by: EgonOlsen 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.
Title: Re: how to create animation, camera move rotate or....?
Post by: hamedf_hamedf 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?
Title: Re: how to create animation, camera move rotate or....?
Post by: EgonOlsen 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 (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.