home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / sgi / 16344 < prev    next >
Encoding:
Text File  |  1992-11-12  |  2.3 KB  |  54 lines

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