Gullen Jim (Jim.Gullen++at++GSC.GTE.Com)
Mon, 16 Dec 1996 15:14:00 -0800
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
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:54:10 PDT