PDA

View Full Version : what is the OpenGL Projection plane ?



Batabek
11-11-2009, 02:54 AM
hi all, I'm wondering what the projection plane is used in the OpenGL perspective transformation matrix. Are the vertices always projected to the near plane (i.e. z=-1).What if we change it to some arbitrary value?

Aleksandar
11-11-2009, 04:54 AM
Change it and you'll see the difference. :)

The most important aspects:

1. By changing near and far clipping planes (near clip plane is the projection plane) precision of Z-buffer is affected.

2. Objects behind the near clipping plane, partially or fully, (with Z-coordinate less than near clipping plane) will be clipped.

Dark Photon
11-11-2009, 06:14 AM
Don't cross-post. << Thread link >> (http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&amp;Number=266920)

Batabek
11-11-2009, 07:01 AM
in some books such as "Computer Graphics by Foley at al."
the projection plane is between the clipping planes (i.e. near and far planes). It also mentions that it is constructed from view parameters(i.e. as in gluLookat() funtion). So is there a specific reason for chosing the near clipping plane for the projection?

Aleksandar
11-11-2009, 09:55 AM
Don't cross-post. << Thread link >> (http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&amp;Number=266920)
How to know which post is right? ;)
Dark, thank you for the warning.
There is the same question on GameDev << Foreign thread link >> (http://www.gamedev.net/community/forums/topic.asp?topic_id=552887)

Anyway, it is interesting how different people answer to the same question differently. :)

Aleksandar
11-11-2009, 09:59 AM
in some books such as "Computer Graphics by Foley at al."
the projection plane is between the clipping planes (i.e. near and far planes). It also mentions that it is constructed from view parameters(i.e. as in gluLookat() funtion). So is there a specific reason for chosing the near clipping plane for the projection?
How can you set projection plane in OpenGL?

Dark Photon
11-11-2009, 10:15 AM
Don't cross-post. << Thread link >> (http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&amp;Number=266920)
How to know which post is right? ;)
Dark, thank you for the warning.
Oh, sorry Aleksandar. Please don't misunderstand. I wasn't getting after you, but the OP. Cross-posting creates confusion. You noticed one post first and posted to it, I noticed the other post first and posted to it, confusion ensues. Not your fault or mine, but the OP's.

Dark Photon
11-11-2009, 10:22 AM
in some books such as "Computer Graphics by Foley at al."
the projection plane is between the clipping planes (i.e. near and far planes). It also mentions that it is constructed from view parameters(i.e. as in gluLookat() funtion). So is there a specific reason for chosing the near clipping plane for the projection?
Well, they've got to choose some plane, and you've got to specify the near plane for clipping, so why not that one?

I should qualify that by "projection plane" I infer you mean the plane on which points are not foreshortened (or elongated) based on the projection.

You can see this pretty easily. Look at the Perspective Projection matrix in Appendix F of the Red Book (google for on-line copy). See those "n"s in matrix cells 0,0 and 1,1? Those neatly cancel for points on the near plane (try it: transform (l,b,-n,1) and see). But not so for points beyond that.

Batabek
11-11-2009, 10:27 AM
in some books such as "Computer Graphics by Foley at al."
the projection plane is between the clipping planes (i.e. near and far planes). It also mentions that it is constructed from view parameters(i.e. as in gluLookat() funtion). So is there a specific reason for chosing the near clipping plane for the projection?
How can you set projection plane in OpenGL?

I'm thinking to alter the projection matrix entries to do that.

Aleksandar
11-11-2009, 12:30 PM
Hey, Dark, don't have to apologize.
Did you see my wink-smiley? I was just kidding.
I am also against cross-posting, and probably would not answer if I saw it on another forum, but unfortunately I have never read posts on Math and Algorithms forum. My fault!

Aleksandar
11-11-2009, 12:45 PM
I'm thinking to alter the projection matrix entries to do that.
It is an interesting idea, but I don't understand how and why you would do that. If you have any interesting idea, share with us, please! :)

But, before doing that, take a look at glFrustum() function. As you can see, there is no trace of projection-plane parameters, and that function is doing its job perfectly. Can you explain why? ;)