PDA

View Full Version : Picking and glPushMatrix



Bagoj
07-21-2002, 05:40 AM
Hi there!

(sorry, english is not my native language)
I have an interesting problem with picking. I'm trying to implement it to my leveleditor and would work fine if i didn't use glPushMatrix and glPopMatrix. Before i draw one of my objects i push the actual matrix then a call glrotatef and gltranslatef then i draw and finally popmatrix (for all objects), and only the first object will be selected, the others are ignored, if they weren't there. If i use translatef(-x,-y,-z)and glrotatef(...) rather then pushing and poping the matrix it works fine. Could anyone please tell me what is going on when it push and pop that stupid matrix? I can think only problems i somehow modify the modelview and the projection matrix too, and i had to change just one of them, or something like this. Please help if you have some ideas. Thanx: Imre Biro from Budapest, Hungary

mphanke
07-21-2002, 01:03 PM
Hi,

I expereinced the same thing. The solution I found: You have to pick on the lowest level of your pushes, meaning what I do is drawing all the objects doing my pick routine and then poping all the way out of the stack.

Greets,

Martin