Archived

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

shalrath

OpenGL "camera" question

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