Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Confused about the near plane of the perspective projection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Confused about the near plane of the perspective projection



On Sep 23, 2003, at 12:50 PM, Robert Grant wrote:

Hi Dan,


On Tuesday, September 23, 2003, at 03:07 PM, Dan Herman wrote:


So the distance to the near plane from the observer is: (h/2)/ tan(fovy/2) ?

I might be misunderstanding you, but the distance to the near plane is just zNear.

Well looking back at the SuperBible it does say (as you say) that zNear is the distance to the front clipping plane. *But* if I use my formula to calculate the viewing transform (i.e. the zOffset) then my rect is drawn perfectly in the 320x240 viewport. If I just offset by 1 then I get massive magnification. So something's not quite clear yet....

Just to be clear (it probably already is...) the edges of both the near _and_ the far plane are coincident with the edges of your context. So as anything moves towards the camera it will fill up more of the screen to the extent it is now closer to the sides of the frustum.

I find it helpful sometimes actually to draw the frustum as lines along with the rest of the scene and look at it from another vantage point from the side (ie, in a second context). If you're drawing the frustum correctly, it will be just barely visible as a 1-pixel bead along the inside edges of your first context. You may need to inset it slightly inwards to actually see it in that context.

However I'm now happy that I can get the correct presentation of my rect in a predictable manner, even if I still don't understand the gluPerspective function :-)

Robert.
_______________________________________________
mac-opengl mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/mac-opengl
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Confused about the near plane of the perspective projection (From: Robert Grant <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.