rendering with vanishing point not at center of screen

Started by
6 comments, last by arnero 4 years, 6 months ago

Is there a way to set up the projection matrix (in OpenGL) so that the vanishing point is not at the center of the screen?

Let me explain what I mean in more detail.  Imagine that I am rendering a 3D scene with a standard perspective projection matrix to a 1000x1000 window.  There is no camera matrix, so planes of constant z are parallel to the screen, and objects move toward the center of the window as their z coordinate approaches infinity.  Now, I want to only render the bottom half of this window.  Planes of constant z are still parallel to the screen, but now objects move to a point at the top of the window as their z approaches infinity.

Advertisement

How about using a stencil to mask out the upper half ?

18 minutes ago, Green_Baron said:

How about using a stencil to mask out the upper half ?

That would work if I were actually just rendering to the bottom half of a 1000×1000 window, although it wouldn't necessarily be the most efficient solution.  But in my case, the upper half of the window doesn't exist - I only have a 1000×500 window.

If I understand you correctly I believe you are looking for "Off Axis Projection", typically used when you want to match the view to a persons head position or for stereo rendering. Like this: https://www.youtube.com/watch?v=-foNLFnrNRc

https://computergraphics.stackexchange.com/questions/5054/render-with-camera-perspective-off-center

http://paulbourke.net/stereographics/stereorender/

Hope that helps.

Boris The Sneaky Russian
3 minutes ago, BorisTSR said:

If i understand you correctly I believe you are looking for "Off Axis Projection", typically used when you want to match the view to a persons head position or for stereo rendering.

 

Yes, that's exactly what I was looking for.  Thanks for the links!

Cool, that was interesting to me as well.

Isn't this the task of the projection matrix? Last time I checked computer guys somehow insist that the origin is top left corner. To get the vanishing point to the center z is added to x and y. After division by z this becomes a constant offset.

I like math and think the origin it bottom left. Then I also place my notbook left and right to stationairy monitors and expand my desktop. Thus now I think for the video card and the os and everyone that the center should be the origin.

I once thought about expanding mode hex to quad line duplication (320x100  or 160*200) to get 2 pages in 64k. Then the base address of each page could point to the center...

This topic is closed to new replies.

Advertisement