In my program i want to be able to make an object (like a plane made with a GL_QUAD) clickable.

So if i have a plane displayed on the screen i want to be able to click on a point on the screen and get the X, Y position on the plane (not the screen). Is this some sort of collision detection or something?

03-26-2006

Perspective

This is called "Picking". Im sure google has lots to say about it, also, NeHe has a tutorial on it.

03-26-2006

hdragon

You can define 2 variables: mouseX and mouseY and set them equal to the mouse's position.

I just read your post again and what I said to do was completely wrong. Nevermind.

03-26-2006

loopshot

Yes it is called Picking and can be done by shooting a ray down the position of the mouse and testing to see if it is intercecting with a plane of test, if this is some sort of first person view just use the cameras look vector for your ray.

03-26-2006

skorman00

Quote:

Yes it is called Picking and can be done by shooting a ray down the position of the mouse and testing to see if it is intercecting with a plane