PDA

View Full Version : changing a 2d app to 3d



cg-hci_novice
09-30-2003, 07:47 AM
Hi,

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.

09-30-2003, 10:00 AM
My guess - you're translating to move the camera away, but not wrapping the whole thing in a glPushMatrix/glPopMatrix.

cg-hci_novice
09-30-2003, 03:05 PM
I believe you are 100% right.

Thanks.

cg-hci_novice
09-30-2003, 07:14 PM
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".

Thanks.

10-01-2003, 05:29 AM
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.