View Full Version : picking and mouse motion

12-18-2009, 11:36 AM
Can anyone give me any tips on how I can get picking and mouse motion to work? I have a scene where inside my house I have a teapot on a coffee table and a red stone on another table. Basically, my question is how do I approach this so that when I move over to each object, I can pick it up and look at it(rotate it around etc.)

12-18-2009, 12:04 PM
One simple way would be to have a limited number of objects that can be "picked-up" and rotated. Then allow the user to cycle thru these with the tab key; make the selected object flash red when selected.

The you just supply the object to your generic "rotate_thing" function.

This will save having to calculate screen coordinates for pointing and clicking, and hence be more "error & fool proof".

12-19-2009, 12:02 PM
Hi Javalurnin,
go through http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=32

12-21-2009, 10:26 AM
Thanks for the tip, but I'm having trouble pulling out the proper code from nehe's tutorials since all I've made is a simple 3D house and I just want to pick the "teapot" and "look" at it. The tutorial seems more geared towards a game.