views:

20

answers:

1

I'd like to add an OpenGL ES view as an overlay to my camera view. From this question and its anser I came to know the two field angles of the iPhone 4 rear camera.

How can I properly set the volume view and its perspective in the OpenGL ES view? Shall I use glFrustum or glOrthof?

(I've seen that gluPerspective takes just one angle as parameter, is it supposing to have a square frustum instead of a rectangular one?)

A: 

It seems that this can be accomplished by using simple trigonometry functions ^^. Just have a look at what a frustrum is, and which values are needed by glFrustum (have a look at this page). This stated, I do not believe that the values reported on the linked answer are the correct ones since they apply a distortion (kind of scaling along an axis) to the rendered images.

rano