Hi, I need some help with OpenGL and rotation.

I have a 3D door surrounded by a holder. The holder needs to move with the door and rotate when it's not on the floor. After that the door must be able to open without affecting the holder.

It's based on getting a door in Monsters Inc. I've uploaded this 15 second video so you can get the idea of what I'm trying to do:

Thanks in advance,


You need to abstract the problem wayyy past "Monsters Inc". You should ask the question generally so it helps the most people. Here are some details and specifics:


Maybe something more like "I have two objects and I want to transform them together" or something like that. You should also post the code that you have tried that did not work and explain what is going wrong.


Thank you for that David, after reading your blog post I went to write a simple piece of code to demonstrate what was happening, and it turns out that I was using the glPushMatrix() and glPopMatrix() functions the wrong way round, and wasn't increasing the numbers I needed for rotation properly.

I will be sure to stick to your suggested explanation method next time.

Thanks again :)


commented: Solved his own problem and reported back the solution - good work! +4


Great! I'm glad it worked. This is a perfect exemplar of what I was talking about :) In the process of explaining your question in a way that others can understand, you clarified it to yourself and figured it out simultaneously!

Keep up the good work.