How can I set the Perspective Camera in game like the picture? (Engine libgdx)

5k Views Asked by At

I am new in 3D game? I am using Libgdx. How can I calculate params for Perspective Camera like Tetromino Revolution game? Please, give me any idea about that.

See the image: http://www.terminalstudio.com/screens/tetrisrev/big1.jpg

2

There are 2 best solutions below

0
On

This is a great tutorial for what you need.

http://blog.xoppa.com/basic-3d-using-libgdx-2/

0
On

You could setup a camera like this:

float fieldOfView = 45;
float w = Gdx.graphics.getWidth();
float h = Gdx.graphics.getHeight();
PerspectiveCamera camera = new PerspectiveCamera(fieldOfView, 1, h/w);
camera.position.z = -2f; //just an example of camera displacement
camera.update();

The bigger the fieldOfView grows, the more perspective will be in your scenery. You can now put your blocks or something onto the x-y-plane and it will probably look similar.

I recommend you to read some tutorials first, to get into the feeling of 3D-programming. It seems as if there will be some other questions in your mind soon.