PDA

View Full Version : About projection and translation in perspective



james xu
04-08-2012, 02:02 AM
I have drawn three cubes in my mobile app. but how to set the projection or translation to make this three cubs laid on my screen.

I have tried:

1. set the frustum 's parameter bottom to zero to make it look from the same direction. (because we can't see the back of the cube )
2. set the all objects' z to same value in translation. ( i don't sure it's right")

but the three objects don't looks on the same plane.

I want the effect like this http://b99.photo.store.qq.com/psb?/V11HpPjw0X0o6R/b2CjsEfVOms6gcyVXsBLthuD6yL0mO3HJjcNcrLxf0g!/b/Yau7AztrSAAAYvhvDjvfSAAA

tonyo_au
04-08-2012, 11:36 PM
With perpective projection the cubes are never 100% flat; but the closer they are to the center of the view the flatter they look. You notice how the dice on its own doesn't look the same as the others. You can try varing the field of view angle (FOV).

You want all the z-value matching if you are looking down the z-axis (the default viewing direction)

If you want them totally flat look at an orthogonal projection (glOrtho)