Vanishing point other than center?

Started by
2 comments, last by Waverider 20 years, 8 months ago
I was playing XWing vs. TIE Fighter the other day and realized that the vanishing point for the rendered graphics is above the center of the screen. Which is nice, because the lower part of the screen is taken up by a readout, so having the vanishing point up higher allows you to see the action below the reticle as much as above and makes it easier to keep what you are firing at in view. My question is, OpenGL has always put the vanishing point at the exact center of the viewport. Does moving the vanishing point around require a particular setting of the viewpoint or a special setup of the frustum? Sorry, I can''t try this out right now, I''m just posting it while I''m curious, plus it might help others with the same question. Thanks!
It's not what you're taught, it's what you learn.
Advertisement
Let w, and h be height and with of the total screen and v be the ''vanishing point''

glViewport(v.x - w/2, v.y - w/2, v.x + w/2, v.y + w/2);
err i mean
glViewport(v.x - w/2, v.y - h/2, v.x + w/2, v.y + h/2);
Ah, cool, so it is a glViewport operation. Thank you.

I assume you mean by 'total screen' that some of it could actually be off the visible monitor screen, which forces the vanishing point around.

And actually, I think the call should be glViewport(v.x-w/2, v.y-h/2, w, h) since the prototype for glViewport is:

void glViewport(GLint x,                GLint y,                GLsizei width,                GLsizei height)  



[edited by - Waverider on August 6, 2003 5:54:33 PM]
It's not what you're taught, it's what you learn.

This topic is closed to new replies.

Advertisement