Disable picking of backfaces (using SoSelection)

Disable picking of backfaces (using SoSelection)

Post by Olaf Menke » Fri, 29 Sep 1995 04:00:00



Hello!

I want to use OpenInventor to model the interior of a room. But when I
try to interact with it, the following problem arises: The walls of
the room have the normals pointing inside, so they appear to be
transparent when viewed from outside. This is nice, as I want to see
the interior of the room.
But: When I try to pick some object inside the room, I can pick only
the bounding walls, as they appear to be the first object, hit by the
ray pick used during selection.

The question is:
How can I modify the picking so that I don't get the first object hit,
but the first object, whose surface is visible (whose normal points
towards the camera) ?

The simplest idea, using a SoPickStyle { pickStyle NONE } to discard
picking of the room doesn't match my needs, as I want to allow picking
the walls of the room (if they are viewed from inside). I think a
better idea would be a pickFilterCallback for the Selection, but this
seems to be quite a lot of work, that has probably already been done
by someone else in this Inventor users community...

Thanks in advance

                Olaf.

--

// Olaf Menkens

//
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// GMD - German National Research Center for Information Technology, H & S
// Schloss Birlinghoven | D-53757 St. Augustin | Phone: [(49)2241] 14-2363

--
                                I  Ingenieurbuero Horz & Schnepf
  Olaf Menkens                  I  TechnoPark der GMD

                                I  Tel.: 49-2241-142363

 
 
 

Disable picking of backfaces (using SoSelection)

Post by Olaf Menke » Sat, 30 Sep 1995 04:00:00


Hi Stephane!

 > You are probably using a SoRayPickAction to do that.

No, at least up to now, I just use a SoSelection node (that in turn
employs a SoRayPickAction). So I can't access the SoRayPickAction's
setPickAll() function, to get more than one picked point.

Currently I suppose, that I'll have to create my own SoRayPickAction
within the pickFilterCallback of the SoSelection node.
This seems to be necessary, if the first picked point, that is passed
to the callback by SoSelection, is not really pickable (i.e. lies on
a backface).

Trying to do so leads me to the next serious problem: as the
pickFilterCallback gets only a SoPickedPoint as parameter, I can't
reconstruct the SoRayPickAction, that created this picked point. This
problem gets even harder, as I use multiple viewers at a time, and I
can't easily determine, in which viewer the picking occured.

The more I think about this problem, the more difficult it seems to
me...

 H E L P !!!

----
P.S.: By the way: In Chapter 10 of the Inventor Mentor ( Pick Filter
      Callback (Advanced) ) the parameters of SoSelectionPickCB() are
      erroneous. (Not a SoDetail, but a SoPickedPoint is passed)
--

// Olaf Menkens

//
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// GMD - German National Research Center for Information Technology, H & S
// Schloss Birlinghoven | D-53757 St. Augustin | Phone: [(49)2241] 14-2363