home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.sgi
- Path: sparky!uunet!ukma!darwin.sura.net!sgiblab!sgigate!odin!koosh.asd.sgi.com!howardl
- From: howardl@koosh.asd.sgi.com (Howard Look)
- Subject: Re: Inventor
- Message-ID: <1992Nov12.180212.29490@odin.corp.sgi.com>
- Sender: news@odin.corp.sgi.com (Net News)
- Nntp-Posting-Host: koosh.asd.sgi.com
- Reply-To: howardl@koosh.asd.sgi.com (Howard Look)
- Organization: Silicon Graphics, Inc., Mountain View, CA, USA
- References: <1992Nov12.072930.1891@nuscc.nus.sg>
- Date: Thu, 12 Nov 1992 18:02:12 GMT
- Lines: 40
-
- In article <1992Nov12.072930.1891@nuscc.nus.sg>, bemlbk@nuscc.nus.sg
- (Liew Beng Keat (Mr)) writes:
- |> The description of complex shapes (triangle meshes and face sets) in a
- |> scene graph would normally consists of separate nodes describing info
- |> like coordinates, normals, transformations and the shape node itself
- |> right?
- |>
- |> And during rendering traversal, different sets of elements in the
- |> rendering traversal state can be altered by the given class of nodes.
- |>
- |> My question is how can I gain access to information such as current
- |> coordinates after a transformation for example without computing it
- |> myself? since the traversal would already have done these calculations.
- |>
- |> Or do i have to access the coordinates directly from the coordinate node
- |> itself, determine the transformation from the SoTransform nodes and then
- |> perform the calculations.
- |>
- |> Please advice. Thanks
- |>
- |> Beng Keat
-
- You're half right. There is no direct way to find out what the
- coordinates are _after_ they've been transformed by the current model
- matrix; the GL does this transformation, we just send down the current
- model matrix and appropriate current coords when we hit the shape node.
-
- However, using an SoCallbackAction, it is very easy to find both the
- current coords and the current model matrix, and do the transformation.
- Given a path to the shape node, set up a preTailCallback, and apply the
- SoCallbackAction to that path. Then in your callback routine, call
- getModelMatrix and getCoordinates3. Then loop through each coordinate,
- calling multVecMatrix to transform the coord. The callback can then
- return ABORT so the traversal terminates.
-
- Hope that makes sense. Check out the SoCallbackAction man page for more
- details.
-
- Howard Look Silicon Graphics howardl@sgi.com (415) 390-1780
- ..__ One of these :) after being run over by one of these O-O
-