iDevGames Forums
How to change zNear and zFar dynamically - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Game Programming Fundamentals (/forum-7.html)
+--- Thread: How to change zNear and zFar dynamically (/thread-4663.html)



How to change zNear and zFar dynamically - Brecht - Dec 29, 2005 05:00 PM

Newbie question #02 :

any tips on how the zNear and zFar parameters of gluPerspective can be changed dynamically?
I've tried all sorts of things with glutPostRedisplay(), amongst others, but it seems I can only manage to alter the gluLookAt dynamically...
Is there perhaps an other way this has to be done with clipping planes or something similar...

Any tip is welcome. Thanks

b.


How to change zNear and zFar dynamically - OneSadCookie - Dec 29, 2005 05:44 PM

just move your perspective calls from the reshape callback into the top of the display callback; that way you can change them each frame.