>
> I was going to attach the souce code to this message, but I've given 
> up, for I know that what I really need is an understanding of the 
> basics of mouse picking..... but I mean the true and real basics. What 
> I mean with basics? I need to understand every line of that 
> pickhandler class for starters.... If not, at least an understanding 
> on how to USE this class...
>
> Anyone's been through a similar situation and/or might be able to help me?
>
> Thank you....
>
> Renan M Z Mendes
Hi,

I have been through exactly that, as I wrote a software for spatial 
geometry. See here: www.raumgeometrie.de

I can assure you that the new pick-classes work perfectly well with 
shape Drawables, all my code is based on that. There must be a simple 
mistake on your side.

But you might want to have a look at my software before reinventing the 
wheel.

The basic function is:

- your mouse is in screen-coordinates
- the screen-coords wil have to be transformed back to world-coordinates 
(which is done automatically by a convenience function of the intersector)
- you will have to make something three-dimensional of the 
two-dimensional screen-coordinates, usually using the near and far 
clip-planes (automatically done by the intersector)
- now you have a segment that lies exactly behind your mouse-pointer
- the segment is intersected with the node that is passed to it
- (this is done roughly like this: Intersection tests are made for the 
bounding volumes of each node, if it intersects, one goes further down 
the tree until real geometry is met. Here intersection is calculated 
against all triangles)

I use a LineSegmentINtersector, which works just perfectly for picking.


Regards,

Andreas



_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to