home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.graphics.avs
- Path: sparky!uunet!ukma!usenet.ins.cwru.edu!agate!stanford.edu!EE.Stanford.EDU!outpost!yergeau
- From: yergeau@outpost.Stanford.EDU (Dan Yergeau)
- Subject: Re: Rendering of flat complex geometries
- Message-ID: <1993Jan28.181908.994@EE.Stanford.EDU>
- Sender: yergeau@outpost (Dan Yergeau)
- Organization: Stanford University
- Date: Thu, 28 Jan 93 18:19:08 GMT
- Lines: 81
-
- Direct mail to hayes%valkris@hac2arpa.hac.com was undeliverable,
- so ...
-
- In article <24830@hacgate.SCG.HAC.COM>, you write:
- |> I'm having the geometry viewer display a GEOM_POLYHEDRON geometry of a
- |> double headed arrow:
- |> / \
- |> /|______|\
- |> / \ (wow, with ascii graphics like this, why use AVS?;^)
- |> \ ______ /
- |> \| |/
- |> \ /
- |>
- |> When I set the render mode to "lines", I observe the expected result in
- |> the geometry viewer window: I see an outline of a double headed arrow.
- |>
- |> HOWEVER, when I set the render mode to "no_light", I don't get a solid
- |> double headed arrow like I want. I get something like this:
- |>
- |> / /\
- |> /|___ / \
- |> / \
- |> \ ____ /
- |> \ / |/
- |> \/ /
- |>
- |>
- |> How can I get a solid double headed arrow like I want? I've tried other
- |> rendering modes but I don't get a solid double headed arrow.
-
- AVS has problems triangulating concave polygons in a GEOM_POLYHEDRON
- geometry when they have multiple concave regions. We've reported
- the problem to AVS support, and are in the queue, but according to the
- last contact with them, this is a low priority item. Perhaps,
- if you report it also, the priority will get bumped, and the problem
- will be fixed sooner.
-
- Our fix was to break the regions into convex polyhedra, which
- AVS cannot possibly mess up. You lose the ability to show clean
- outlines, but at least the surface representation is correct. The
- algorithm is
-
- begin:
- project the polygon onto a plane
- pick a starting point
- progress around the polygon in a fixed direction (CW or CCW)
- foreach point
- check the direction of the turn
- (needs last, current, and next point)
- if the direction is incorrect (e.g. left when going CW) then
- mark current point
- continue progressing around the polygon, searching
- for a next point that
- 1. has the correct turn direction
- 2. creates a line segment from the current point
- that does not intersect any other line segments
- in the polygon
- break the polygon into two polygons by drawing a
- line between the current and next point
- apply the algorithm recursively on each polygon
- end if
- if current point is the starting point then
- congratulation, the polygon is convex!
- end if
- end foreach
- end:
-
- It may not be the most efficient algorithm possible, but it works.
-
- If you intelligently work with their GEOM file representation, you could
- even triangulate the regions yourself, generating a consistent
- GEOM_POLYTRI object with the correct outline data.
-
-
- Dan Yergeau
- yergeau@gloworm.Stanford.EDU
- #include <std.disclaimer>
-
-
-
-
-