Jump to content
  • Advertisement
Sign in to follow this  
Jotaf

Quick question about setting up the perspective

This topic is 4800 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

Hi! This is a small project so I don't wanna spend too much time on this problem. I'm sure you guys have the answer, this should be very common. I want my scene's perspective so that the units used to set up the vertices' positions in the XY plane match the visible pixels in the window. So if my window is 640x480, I want to be able to create polygons using 0 to 640 for the X, and 0 to 480 for the Y. glOrtho works for this, but then I lose the 3D perspective - when a polygon is closer to the screen (altering the Z) it doesn't get any bigger. The problem is that glPerspective doesn't provide an easy way to set up these conditions. Any thoughts? Thanks for your help!

Share this post


Link to post
Share on other sites
Advertisement
Hi,
I didn't quite understand what do you want to do, but you cold try to use glFrustum(left,right,bottom,top,near,far) instead of gluPesective. Sometimes its easier to work with it (well at least for me ;o) )
Take a look here: http://www.cs.uregina.ca/Links/class-info/405/WWW/Lab3/lab3fig5_13.jpg

Y.

Share this post


Link to post
Share on other sites
I'm sorry if I didn't explain myself very well. Anyways, glFrustum is exactly what I was looking for, I should have read some literature on it. It's working now, thank you :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!