Zooming in Ortho mode? Anyone, anyone?

Started by
1 comment, last by binary1230 22 years, 8 months ago
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?
Draw your own conlcusions.~Dom C.
Advertisement
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
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

This topic is closed to new replies.

Advertisement