home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / graphics / avs / 1091 < prev    next >
Encoding:
Text File  |  1993-01-28  |  3.0 KB  |  92 lines

  1. Newsgroups: comp.graphics.avs
  2. Path: sparky!uunet!ukma!usenet.ins.cwru.edu!agate!stanford.edu!EE.Stanford.EDU!outpost!yergeau
  3. From: yergeau@outpost.Stanford.EDU (Dan Yergeau)
  4. Subject: Re: Rendering of flat complex geometries 
  5. Message-ID: <1993Jan28.181908.994@EE.Stanford.EDU>
  6. Sender: yergeau@outpost (Dan Yergeau)
  7. Organization: Stanford University
  8. Date: Thu, 28 Jan 93 18:19:08 GMT
  9. Lines: 81
  10.  
  11. Direct mail to hayes%valkris@hac2arpa.hac.com was undeliverable,
  12. so ...
  13.  
  14. In article <24830@hacgate.SCG.HAC.COM>, you write:
  15. |> I'm having the geometry viewer display a GEOM_POLYHEDRON geometry of a
  16. |> double headed arrow:
  17. |>   /      \
  18. |>  /|______|\
  19. |> /          \       (wow, with ascii graphics like this, why use AVS?;^)
  20. |> \  ______  /
  21. |>  \|      |/
  22. |>   \      /
  23. |> 
  24. |> When I set the render mode to "lines", I observe the expected result in 
  25. |> the geometry viewer window: I see an outline of a double headed arrow.
  26. |> 
  27. |> HOWEVER, when I set the render mode to "no_light", I don't get a solid 
  28. |> double headed arrow like I want.  I get something like this:
  29. |>            
  30. |>   /     /\
  31. |>  /|___ /  \
  32. |> /          \ 
  33. |> \    ____  /
  34. |>  \  /    |/
  35. |>   \/     /
  36. |>   
  37. |> 
  38. |> How can I get a solid double headed arrow like I want?  I've tried other
  39. |> rendering modes but I don't get a solid double headed arrow.
  40.  
  41. AVS has problems triangulating concave polygons in a GEOM_POLYHEDRON
  42. geometry when they have multiple concave regions.  We've reported
  43. the problem to AVS support, and are in the queue, but according to the
  44. last contact with them, this is a low priority item.  Perhaps,
  45. if you report it also, the priority will get bumped, and the problem
  46. will be fixed sooner.
  47.  
  48. Our fix was to break the regions into convex polyhedra, which
  49. AVS cannot possibly mess up.  You lose the ability to show clean
  50. outlines, but at least the surface representation is correct.  The
  51. algorithm is
  52.  
  53.     begin:
  54.     project the polygon onto a plane
  55.     pick a starting point
  56.     progress around the polygon in a fixed direction (CW or CCW)
  57.     foreach point
  58.         check the direction of the turn 
  59.           (needs last, current, and next point)
  60.         if the direction is incorrect (e.g. left when going CW) then
  61.         mark current point
  62.         continue progressing around the polygon, searching
  63.           for a next point that
  64.             1. has the correct turn direction
  65.             2. creates a line segment from the current point 
  66.                        that does not intersect any other line segments 
  67.                        in the polygon
  68.         break the polygon into two polygons by drawing a
  69.           line between the current and next point
  70.         apply the algorithm recursively on each polygon
  71.         end if
  72.         if current point is the starting point then
  73.         congratulation, the polygon is convex!
  74.         end if
  75.     end foreach
  76.     end:              
  77.  
  78. It may not be the most efficient algorithm possible, but it works.
  79.  
  80. If you intelligently work with their GEOM file representation, you could
  81. even triangulate the regions yourself, generating a consistent 
  82. GEOM_POLYTRI object with the correct outline data.  
  83.  
  84.  
  85. Dan Yergeau
  86. yergeau@gloworm.Stanford.EDU
  87. #include <std.disclaimer>
  88.  
  89.  
  90.  
  91.  
  92.