Robert Nitti schrieb:
It's a silly little thing not even worth posting. I build a flat list
of drawables and geodes while looping through the list of hits. If the
address of a geode or drawable is the same as any previously inserted in
the list, I reject it.
I'm CERTAIN there is a more elegant way of doing this... but I didn't
look much further than my nose, so...
Hi,
you could either use a std::set instead of a list, or use the std -
algorithm "unique" which deletes doublettes from a list.
The std::set is unsuitable in case you want to preserve the order of the
hits (i.e. want to know which object comes first).
Regards,
Andreas
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jeremy L.
Moles
Sent: Tuesday, June 12, 2007 1:33 PM
To: osg users
Subject: RE: [osg-users] Pick
On Tue, 2007-06-12 at 11:56 -0400, Robert Nitti wrote:
Hi --
'Picking' creates an osg::LineSegment that will intersect your
scene...
all the way through. So if you have (for example) a box shape, and
you
are picking one side, it's very possible (in fact, almost certain,
unless you've done something special to prevent it) that the list of
pick items will return the opposite side to you also; so you are
correct
Jeremy in saying that you can pick the same "object" twice.
I've created my own post-filter to clean-up the list of drawables and
geodes so that I don't treat them twice.
Is this code you would have permission to post here or attach to a
response? :) I'd be very interested to see optimized versions of such an
operation...
I hope this helps.
Thanks
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jeremy L.
Moles
Sent: Tuesday, June 12, 2007 10:59 AM
To: osg users
Subject: Re: [osg-users] Pick
On Tue, 2007-06-12 at 16:52 +0200, [EMAIL PROTECTED] wrote:
Dear All
I implemented a Picking function...
In order to debug the picking function I simply print in monitor the
id of the picked drawable.
The problem is that the picking function is called two time for each
mouse click.
I don't think your picking function is getting called twice--I think
you're seeing the same object twice in your pick results, which is
something I'm running into myself. I just started learning picking
this
weekend, so I'm not 100% sure what's going on, but perhaps someone
else
will be able to chime in and help us both.
I originally suspected this had something to do with having a 2D HUD
Camera in my scene, but I don't think that's it.
_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/