View Full Version : How to drag object in opengl by mouse?
The position and direction of the object is changed at anytime.I want to drag the object by my mouse.
How to do this in opengl?
I'm sorry for so many question?this is the last http://www.opengl.org/discussion_boards/ubb/smile.gif
Thanks everybody here.
02-14-2004, 07:53 AM
dragging involves selection. So search on this forum for "picking".
For draging, I think you could first transform a point on the object to window space
then feed this into...
gluUnProject(mouse.x, mouse.y, object.z, ....);
to get back that point, and find the new translation for the object.
Dragging in ortho projection can be simpler though.
02-14-2004, 12:20 PM
C'mon, this has nothing to do with Advanced OpenGL. This is a UI question, and possibly a question on whatever scene graph library you're using.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.