Skip to main content
gamedev.net
🔒 Locked

Mouse Control

Started by Sav Jan 4, 2001 at 11:43 AM 2 replies 450+ views
Original Post
Sav
Sav
Hi I was just wandering... In Lesson 5 objects spin by themselves, which is nice, but I would really like to know how to control the movement of objects in x, y and z directions by click-dragging the mouse (as in lightwave modeler preview window). Can this be accomplished with OpenGL or is it an OS specific task? In which case I'm using a Mac, Os9 (complete novice) Thanks Edited by - Sav on January 4, 2001 12:46:26 PM
dallas
dallas
your desired effect will almost be os driven. a possible way to accomplish this may be the following (although i don''t use a mac, i would imagine that the process would be pretty much similiar):
first, respond only when a mouse button is down, then capture the position of the mouse in relation to the center of the screen (or the position of the objects center, depending on how you wish to implement this). capture the mouse coordinates (mouse.x and mouse.y) and apply them to the objects rotation (rotate.x and rotate.y).
the z rotation may not be nessesary since you can then move the object up/down and left/right to view it in any position.
hope this helps...
Sav
Sav
Thanks
It is helpful because it makes good sense, but I am such a novice at all programming that it''ll probably take some time to actually implement it as code
ogl
ogl
you need gluProject() - i''m looking into mouse dragging and i''m pretty stuck

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.