Re: Intersection of viewing frustum and a plane

New Message Reply Date view Thread view Subject view Author view

Gullen Jim (Jim.Gullen++at++GSC.GTE.Com)
Mon, 16 Dec 1996 15:14:00 -0800


> On December 16, 1996 8:20AM Brian Furtaw wrote
>
> I am trying to intersect a plane (point on the plane (0,0,0) planes, normal
> vector of the plane (0,0,1)) with a pfFrustum, the current view frustum.
Should
> I maybe be trying to do this with a pfPolytope instead? Then I would only
have
> to intesect the six facets with my plane at the origin. The desired result
> would be the plane trimmed to fit inside the frustum. This allows me to
compute
> the minmum amount of surface features. Does anyone know how to do this?

The intersection of the "standard" view frustum with the ground plane (z
= 0)
will always be a quadralateral, triangle, or no intersection.

You can easily create 4 line segments originating at the frustum's Near
corners and extending to their corresponding Far corner. You would then
need to intersect these against a relatively huge "ground" face to get
the
0, 1, 2, 3, or 4 points of the frustum's intersection with the simulated
ground
plane (note: actually, you'll need to work with the line segments for
all 12
edges to cover all cases, but you can still get only a quad, tri, or nil
intersect).

You will also need to relate the 4 line segments and ground face into
the same coordinate system. The easiest way is to relate the ground
face (its vertices) to the line segments. Do this by attaching the
ground
face geode as a child node of a pfDCS node. The required pfDCS matrix
will be the inverse of the channel-to-world matrix:

        pfMatrix dcsMat, offsetMat, viewMat;
        chan->getOffsetViewMat(&offsetMat);
         chan->getViewMat(&viewMat);
        dcsMat->multMat(offsetMat, viewMat);
        dcsMat->invertFull(mat);

Suggest you read man pages for pfSegSet, pfNode::isect, pfDCS.
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:54:10 PDT

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