Archived

This topic is now archived and is closed to further replies.

Vanishing point other than center?

This topic is 5242 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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);

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
err i mean
glViewport(v.x - w/2, v.y - h/2, v.x + w/2, v.y + h/2);

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites