Mail Archives: djgpp/1998/03/25/14:14:00
Theuzifan wrote:
> Hi all!
> Did you have any idea on how to implement a mouse in a 3D environment?
> I mean, I have a 3D world, I have a mouse, and I want to know at what
> 3d object I've clicked... what should I do?
>
> Thanks in advance!
>
> Theuzifan Sumachingun
> Tema de refexion de la semana:
> - Por que se me olvidan todos los temas de reflexion que pienso en casa?
The "easy" way is to define a clipping frustrun centered on a line that
passes from the eye point to the point in the screen plane that the mouse
pointer is currently on. Then, just(just he says :-) clip the scene to the
frustrum, just like you clipped it to the viewing frustrun. The result will
be a list of polygons or what ever that MIGHT be the ones you want. Then
sort them and pick the one nearest to you, or farthest, or what ever rule
you want to use.
Bob P.
- Raw text -