Jump to content
  • Advertisement

Archived

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

shalrath

OpenGL "camera" question

This topic is 5412 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 have a series of polygons being drawn between 0-128 on the x-axis, 0-255 on the y-axis (up-down), and 0-128 on the zaxis. My question is, how can I "look" at them in my opengl window. I want to get an aerial view of the whole terrain, on an angle so I can see the contour... how can I achieve this?

Share this post


Link to post
Share on other sites
Advertisement
Easiest way is to use gluLookAt. You choose a viewer/eye position, a point to look in the direction of and an ''up'' vector which represents which way you want up to be.

The look at point can simply be the center of your polys you want to see. Adding a constant x and y offset to this can produce your eye position (suitably large to get the correct height and angle). The up vector doesn''t need to be precise so you can just stick in something that gives the general direction like (0,1,0).

Experiment with the values and you''ll see how you can control the view like that.

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!