
object space -> screen space
Posted Thursday, 25 September, 2008 - 06:52 by max0180 inhi,
Ive a couple of 3d objects(in object space). when my mouse is over one object, i want to know which one.
how can i do it?
my thought: from my mouse position, i construct an orthogonal vector into the object screen and then i want to know which object touches my vector.
but dont know how?
markus


Comments
Re: object space -> screen space
This is the "picking problem". There are several solutions.
The most simple solution (in my point of view) is the one you are outlining: build some collision routines (triangle-ray, sphere-ray) and check which object in your scene collides with the "ray" going through your screen from your "eye" (0,0,0). If several objects collide, choose the object which is closest.
Another technique is discussed here:
http://www.opentk.com/node/213