changing a 2d app to 3d


I have a 2d app that I am changing to be 3d. Where I was previously using 2d orthographic view, I am now using gluPerspective and gluLookAt in my display routine. When I run it, I can see the original display briefly but it rapidly seems to get “sucked” into a “black hole” in the center of the screen. In other words, it appears to shrink till it dissapears entirely.

I was wondering if there is something obvious I am doing wrong in converting this app into 3d that is causing this behavior with the display?

Thanks for any ideas.

My guess - you’re translating to move the camera away, but not wrapping the whole thing in a glPushMatrix/glPopMatrix.

I believe you are 100% right.


There is one caveat to my prev post.

Is it legitimate to have the Push/Pop Matrix around manual translates?

I am trying to avoid “fixing what isn’t broken”.


I’m not certain I understand the question, but I think the answer is “Sure, why not?”

The Push/Pop system just manipulates the stack of transformation matrices - how the transformations are generated is irrelevant.