Skip to main content
gamedev.net
🔒 Locked

Mouse support

Started by johnnypark 2 replies 300+ views
Original Post
johnnypark
johnnypark
I am a novice programmer and I have been working on a few simple projects with NeHe''s basecode. I have found the tutorials here very informative, however there is one area that I havent been able to find any usefull info on : setting up and utilizing the mouse cursor. What I am hoping to do is set it up so I can Click on 2d and 3d objects in the window and have stuff happen. If anyone could give me some pointers or point me to a site that has such info, It would be muchly appreciated. Johnny
dede
dede
Nehe has a selection tutorial,Tutorial number 32, that allows you to tell if a 3d object is under your mouse

The other way is to look up gluProject() and gluUnProject(). These functions take your 2d point, and place it in a 3d model space, where then you can figure out where you''re object is...

Then you can use simple sphere <-> sphere collision to tell if your mouse is close to the point you''d like to manipulate....

walshb
walshb
Since you're just starting out I would recommend looking at the GLut. They have functions for mouse intereaction that are pretty simple.

Here's a link for the latest library:
Here

and here's where to find the spec:
Here

Have fun!

-B

[edited by - walshb on May 24, 2003 7:23:05 PM]
I need no signature... well, alright.http://www.derzwerg.net
johnnypark
johnnypark
wow, I hadn''t looked at tut 32 yet, lots of stuff here! Cool game too

Thanks for the replies

Topic Locked

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

Sign in to reply to this topic.