🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

glScale and Frustum, use which to zoom the scene?

Started by
2 comments, last by WWWFdisk 18 years, 3 months ago
When I fixed the problem of normal during glScale, I suddenly found that I can zoom into the scene by adjust the volume of the frustum. Using a small frustum causes objects in it look big. And large one, small. So I'm thinking about which one should I use in a "Real" project. Are they (using glScale and adjust the frustum) same things? If they are not, which one will have better performance? Help me, please! Thanks to every one reading this message!
Advertisement
Well glScale doesn't actuarly zoom the image, it just makes everything bigger(or smaller), and if everything is bigger in a perspective world, nothing is bigger.

Most(if not all) projects use the frustum to zoom with, it's easy to use and works in more or less the same way a zoom lens works.
As long as the inverse scaling isn't also applied to the view matrix, then scaling the world has of course an effect.

Using a uniform _global_ glScale will also change the depth (w.r.t. the camera) component, and hence doesn't simulate a zoom but a getting closer! This may have side-effects since the near and far clipping planes will be visually positioned closer to the view volume's center (say, more geometry may be clipped in front and back).

So, glScale used for zoom must be performed in view space and be applied to the view's local horizontal and vertical axes only but not the depth axis.

Quote: Original post by lc_overlord
Most(if not all) projects use the frustum to zoom with, it's easy to use and works in more or less the same way a zoom lens works.

So do I ;)
Thanks!
I've choosen applying a frustum for zooming. As you've said, it is easy to use and understand, also avoids a lot of side-effects.
:)

This topic is closed to new replies.

Advertisement