Re: gluUnproject

New Message Reply Date view Thread view Subject view Author view

From: Simon C Mills (simon++at++wgs.estec.esa.nl)
Date: 12/13/2001 01:53:54


Dimi wrote:
>
> Hi,
> I am facing currently the problem of how to get a 3D vector into my 3D
> world from the mouse position(x,y) on the window.
> I would like when a mouse button is pressed to compute this vector based
> on where my mouse is, and perform an intersection
> test to see if anything was hit. Like shooting a ray from your mouse
> into the world and see if anything was hit.
> In OpenGL I use the gluUnproject(...) function. Is there any other
> similar function which I can use in Performer
> which has the same function.
> I have found that I could use the pfChannel::pick(...) function but
> since it only handles intersection tests with ALL the scene
> graph it does not suit. I would like to be able to seletively perform
> intersection tests with arbitrary subgraphs.

Yes, you can use pfChannel::pick() to do selective picking. You need to
set up the intersection mask of the nodes you want to select with.
Quoting from the pfChannel man page:

     pfNodePickSetup enables the entire database tree under node for
picking
     intersections and should be called with a pointer to the
pfChannel's
     scene graph. This effectively calls pfNode::setTravMask with
     PFIS_SET_PICK. Selective picking can be done by calling
     pfNode::setTravMask, setting the traversal to PFTRAV_ISECT and
including
     PFIS_SET_PICK in the intersection mask for nodes that are to be
enabled
     for picking intersections. The picking traversal will not continue
past
     any node that has not been enabled for picking intersections. See
the
     pfNode::setTravMask manual page for more information on
intersection
     setup.

Have a good read through the (rather long) pfChannel man page.

Regards, Simon
_______________________________________________________________________

Simon Mills
Modelling & Simulation Section (TOS-EMM) Tel: +31 (0)71 565 3725
European Space Agency (ESA/ESTEC) Fax: +31 (0)71 565 5420
Postbus 299, 2200AG Noordwijk e-mail: Simon.Mills++at++esa.int
The Netherlands http://www.estec.esa.nl/wmwww/EMM
_______________________________________________________________________


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu Dec 13 2001 - 01:48:06 PST

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.