www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: drounal on May 15, 2006, 09:04:22 pm

Title: free camera
Post by: drounal on May 15, 2006, 09:04:22 pm
Hi everyone !

I'm a total beginner trying to make a video game using jpct. I used the sources of the examples to help me out and, so far, it works fine. but a problem raised with the camera.

In the "car" example, the camera is attached to the car: I want to set it free. For the moment, I removed the movement but I can't manage to make it move using the keyboard. Each movement done pressing a given key, is undone when releasing the key ...

Has anyone got a model or any hint ?
thx
Louis
Title: free camera
Post by: EgonOlsen on May 16, 2006, 05:24:10 pm
The camera itself is quite simple to use. Just get it from the world and call the moveCamera-methods with the movement constants needed for the desired direction. The car example does a bit more to keep the camera following the car and obviously, you've removed just one part of this code but not the complete code, so that somewhere the camera is still set to...whatever. Maybe the fps-example is close to what you are looking for.
Title: free camera
Post by: Melssj5 on May 16, 2006, 07:48:28 pm
Look at the fps example. There you move the camera using the keyboard.

The camera can be moved using the MoveCamera methods, you just need to give a direction and a speed. place the method on the event you need. Its better to use the KeyMapper than the normal java events.
Title: free camera
Post by: drounal on May 16, 2006, 08:54:37 pm
thx, it works fine !
++