Jump to content
  • Advertisement

Archived

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

MARS_999

Top down view with gluPerspective()

This topic is 5476 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 would like to change my view to top down viewing. Which would be looking down on Y axis for me. How do I go about that? Would I put a -1 for Y in gluLookAt()? Thanks

Share this post


Link to post
Share on other sites
Advertisement
Assuming your scene is in the xz-plane through the origin... reasonable parameters for gluLookAt should be something like this:

gluLookAt(0.0,10.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0);

meaning:
parameter 1-3 observer position: (0.0,10.0,0.0) - above the scene
parameter 4-6 looking towards: (0.0,0.0,0.0) - origin, part of the xz-plane.. so part of your scene
parameter 7-9 upvector : (0.0,0.0,-1.0) - anything thats orthogonal to the viewing direction(that would be (0.0,-1.0,0.0) in this case, or ....

'looking towards' - 'observer position'
-----------------------------------------
|'looking towards' - 'observer position'|

.... the viewing direction i mean.

Michael

[edited by - plasm on August 17, 2003 10:37:50 PM]

Share this post


Link to post
Share on other sites
I don''t know if this is the correct way but I added in a glRotatef() before gluLookAt() and left my gluLookAt() with Y as up 1.0 and now the camera is looking down towards the terrain.

Share this post


Link to post
Share on other sites

  • 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!