View Full Version : Moveing the projection plane
I trying to produce some anaglyphs in openGL for a professor of mine and I've come across a problem. When I'm drawing my scene for each eye's view I need some way to move the projection plane. From what I understand the projection plane is considered to be the near clipping plane. But to produce anaglyphs (with positive and negative paralx)I need objects infront of and behind the projection plane to be drawn. With the a clipping plane being the projection plane this isn't possible. Is there anyway to move the projection plane? And if not can someone suggest other ways to draw the scene to get all these requirements?
dont realy understand what you try to do!!! but try this:
split your view frustum into two frustums by dividing the big one along the z-axis (near/far-axis). then draw near one with depthtest greater and the far one with depthtest less so you will see the scene as you would look from the plane in both directions, or reverse greater and less to get a view produced as would you look at the plane from both sides
but i think this isnt what you want ?!?
03-22-2002, 10:46 AM
The projection plane is not the same as the near clipping plane. The projection plane has the same width in world space units as the screen has in pixel units and the same height in world-space units as the screen has in pixel units. So if your screen is 320X200 the projection plane will be the plane in the view frustrum that is 320X200 in world space units. The distance between this plane and the view point is:
(SCREEN WIDTH/2) / tan(VIEW ANGLE/2)
03-24-2002, 12:43 PM
Don't worry about the "location" of the projection plane. Just draw your scene somewhere between the near and far planes.
Use gluLookAt to position and orient the camera, gluPerspective to set up the perspective projection and glViewport to set the size and location of the viewport.
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.