Nonconvex polygon rendering
- To: mathgroup at smc.vnet.net
- Subject: [mg15206] Nonconvex polygon rendering
- From: Erik Demaine <eddemain at daisy.uwaterloo.ca>
- Date: Tue, 22 Dec 1998 04:01:37 -0500
- Organization: University of Waterloo
- Sender: owner-wri-mathgroup at wolfram.com
Hi everyone, I'm having trouble rendering nonconvex polygons in 3D with Mathematica 3.0.1.1. The problem is that the polygon gets triangulated, which causes filling of the exterior of the polygon. According to the help on Polygon, planar polygons in 3D are supposed to be rendered "exactly." Is this true? Is there an option I have to set to draw nonconvex polygons accurately/carefully? (This is the case for some graphics languages such as OpenGL.) Here is a really simple example which fails, and which Mathematica should be able to determine that it is planar because all of the coordinates are integral: Show [ Graphics3D [{ Polygon [{ {0,0,0}, {1,0,0}, {1,1,0}, {2,1,0}, {2,2,0}, {0,2,0} }] }] ] Am I missing something? If there is really no way to render nonconvex polygons correctly in the direct way, what's the best way to do it indirectly? Does anyone have some triangulation code? Even if I subdivide into triangles, how do I hide the chords (interior edges of the polygon) from showing up in black? Please send responses via email. Thanks! Erik -- Erik Demaine \( e-mail: eddemain at daisy.uwaterloo.ca (PGP avail.) Dept. of Computer Science \) URL: http://daisy.uwaterloo.ca/~eddemain/ University of Waterloo (\ "Geometry ... like all of mathematics, should Waterloo, ON Canada N2L 3G1 )\ not be a spectator sport!" -David Wells