Menu
Sites
Language
Where is the screen location in the OpenGL perspective coordinates?

Below is OpenGL Perspective Viewing Frustum,

 

My question is, if we draw 3D object based on this perspective viewing frustum, where is the phone screen located at?

Is it just overlaped the near plane?

Responses

2 Replies
Jeongsu Kim

I am not good at OpenGL so this may be wrong.

I think phone screen is at the camera. 3d objects between near and far area are captured by the camera.

Let's think normal camera. Objects are there, you just press shutter button. Now camera show just one layer image that contains objects.

Xaemin Cho

 

As already self-answered, near plane is just matched to phone screen.

Every object must be located between near and far plane, out of this range objects will not be rendered to save rendering cost.

 

One more thing, if you want to make a movement based on 2D pixel coordination in OpenGL, you can convert near plan size in pixel using tangent with fovy and near plane coordinate. That is essential for drawing UI on 3D game.