PDA

View Full Version : Moving selected objects in OpenGL



alucard_ad
07-28-2012, 02:52 PM
i add 3 object at same time (object a, object b,object c),now i try moving object b, who know how can move it?

Catsunami
07-31-2012, 01:26 PM
Are you trying to use user input with a mouse? In that case I'd say read up on picking. Here is a good article: click (http://content.gpwiki.org/index.php/OpenGL:Tutorials:Picking).
You will need to have a way to detect a mouse button down event (when you click), motion (typically "move") and when the user lets go of the mouse button. Track the pointer coordinates and covert them to your GL window coordinates.