• ### Announcements

#### Archived

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

# Vanishing point other than center?

## 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 on other sites
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 on other sites
err i mean
glViewport(v.x - w/2, v.y - h/2, v.x + w/2, v.y + h/2);

##### 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]

• ## Partner Spotlight

• ### Forum Statistics

• Total Topics
627689
• Total Posts
2978648

• 13
• 14
• 12
• 10
• 12