Archived

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

Zooming in Ortho mode? Anyone, anyone?

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

OK, I am building an overhead 2D map editor. Basically it just uses an ortho setup, but I cant quite figure out how to zoom correctly. I have tried specifying new clipping planes with glOrtho(), but its always offset by a large amount [actually I think the cause is that I have the y-axis flipped] Another method I''d prefer to use is modifying the modelview matrix. Instead of messing with the projection matrix, I''m wondering if the same effect can be accomplished using glScalef() or something like it. I''d prefer it this way. I think I remember reading somewhere that there was an actual matrix you could multiply by to zoom [not an prebuilt openGL matrix, just a mathmatical matrix]. Any ideas? Thanks ~Dom C. Bueler?

Share this post


Link to post
Share on other sites
the first method is the prefered method
u could have some variable called zoom say and just change that value.
glOrtho( -10.0/zoom, 10.0/zoom etc

if u use glScale if u use lighting u will need to renormalize the normals

Share this post


Link to post
Share on other sites
hi there,

you can use glScale but if your not scaling your normals you
need to enable GL_AUTO_NORMAL to get proper lighting results.

hope it helps

Mark

Share this post


Link to post
Share on other sites