Reputation: 31
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
Upvotes: 2
Views: 5093
Reputation: 1286
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.
Upvotes: 2