Handling camera functions in jpct

584 Views Asked by At

I am working on android game. In this I am using JPCT framework. In this I want to use camera movement.As in some games the whole level view is viewed to the user( like in Angry Birds). I am putiing my code in OnDraw() function.

@Override
 public void onDrawFrame(GL10 gl) 
 Camera cam = world.getCamera();
 cam.moveCamera(Camera.CAMERA_MOVELEFT,2);

Now, when this executes it continuously goes to the left. I want to use various camera functions like it goes left them zoom in on particular object then zoom out and then move right;something like that. How I would be able to do so?? I am very new to programming.

1

There are 1 best solutions below

0
On

You have to use cam.setPostion(); to position the camera at your desired coordinates. cam.moveCamera() is to move it continuously, like panning.

For the zooming part, you have to change the FOV of the camera. More the FOV, more you can see i.e zoomed out.