Re: [info-performer] No correct transform for Isect?

Date view Thread view Subject view Author view

From: Paolo Farinelli (paolo++at++sgi.com)
Date: 06/27/2003 20:09:27


Hi Jeroen,

The behavior you observe is correct, although maybe not
completely intuitive.

You have to bear in mind that a pfNode can have multiple
parents, each with a different hierarchy of transformations.
Thus there is no implied unique matrix associated with a
pfNode, and this 'cumulative' transformation is not stored
at the pfNode level.

So, if you just call node->isect, intersections will be carried
out assuming node is not subject to any transformation.

For example, in your case, you could add the same GSET
(pfGeode, really) to two DCSs, and add both DCS to your
scene. If you then called Geode->isect, it would be impossible
to figure out what you intend to isect against.

So, you have a couple of options:

1. intersect against your root node or against your top DCS
2. compute the cumulative transformation matrix above your
    node, then transform your segsets by the inverse of such
    matrix and isect against node.
3. compute the cumulative transformation matrix above your
    node, then use pfChannel::isect instead of pfNode::isect.
    You will note that pfChannel::isect takes in a pfMatrix* as
    its last argument. This will spare you from having to
    transform your segset..

Hope this helps,
ciao,
Paolo

Jeroen Akershoek wrote:

>Hi,
>
>I've come across a weird thing and I don't think it should be that way. I've got the following piece of scene-graph:
> DCS
> / \
> DCS DCS
> | |
> GSET GSET
>
>The upper DCS has a translation/rotation set, the rest is default.
>When I isect with the upper DCS, things go fine. Isecting with one of the lower DCS-es doesn't work correctly though. It seems the isect doesn't take the matrix from the parent scene-graph into account and isect with the untransformed GeoSet. Is this a bug, or a well-thought-out thing?
>
>I'm using Performer 3.0.1/gcc3 on Linux.
>
>Regards,
> Jeroen
>
>

-- 
Paolo Farinelli                                           paolo++at++sgi.com
Member of Technical Staff, OpenGL Performer              1-650-933-1808
Silicon Graphics        1600 Amphitheatre Pkwy, Mountain View, CA 94043


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Fri Jun 27 2003 - 20:09:37 PDT