View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# Fidning the coordinates of the edges of the screen

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

4 replies to this topic

### #1griffenjam  Members

Posted 25 October 2001 - 12:04 PM

I know this sounds dumb, but I can''t figure out how to find out the coordinates of the edges of the screen. I initally thought that it was a set number, but I guess not. Is there a formula? Jason Mickela ICQ : 873518 E-Mail: jmickela@sbcglobal.net ------------------------------ "Evil attacks from all sides but the greatest evil attacks from within." Me ------------------------------

### #2Shag  Members

Posted 25 October 2001 - 01:23 PM

Are you talking 2D or 3D?

"Evil attacks from all sides
but the greatest evil attacks
from within." Me

Me = you or Windows ME edition?

Edited by - Shag on October 25, 2001 8:26:52 PM

### #3a2k  Members

Posted 25 October 2001 - 01:55 PM

the extents would be whatever you set for glViewport in 3d or in glOrtho in 2d

### #4Dactylos  Members

Posted 25 October 2001 - 02:26 PM

a2k: glViewport should be called in the same way regardless of whether you''re going to setup an orthographic projection or a perspective projection. It provides the mapping from normalized device coordinates to window coordinates.

griffenjam: It depends on how you setup your projection matrix.

### #5griffenjam  Members

Posted 26 October 2001 - 04:41 AM

I set up my projection like this.

gluPerspective(45.0f,(GLfloat)glWidth/(GLfloat)
glHeight,0.1f,1000.0f);

Now, given the current depth can you figure out the displayable width and height?

Jason Mickela
ICQ : 873518
E-Mail: jmickela@sbcglobal.net
------------------------------
"Evil attacks from all sides
but the greatest evil attacks
from within." Me
------------------------------

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.