How to draw filled in polygon
by Matt Fischman · in Torque X 2D · 07/04/2008 (11:58 pm) · 4 replies
I cant figure out how to do this.. the T2DPolygon class is using line strips which I don't believe can be filled in. Is there another/better method for doing this?
About the author
#2
07/05/2008 (12:38 am)
I'm trying to generate an explosion looking polygon, basically a circle with with triangles jutting out, random sizes and angles. I've got it working as a T2DPolygon, line strip, but I want to color it. Is there no way to created colored/textured polygon?
#3
http://www.cs.unc.edu/~dm/CODE/GEM/chapter.html
-Tim
08/02/2008 (8:47 am)
Investigate polygon triangulationhttp://www.cs.unc.edu/~dm/CODE/GEM/chapter.html
-Tim
#4
Edit: I posted the code in the private forum. See www.garagegames.com/mg/forums/result.thread.php?qt=77768
08/03/2008 (8:58 am)
T2DPolygon is drawn as PrimitiveType.LineStrip (i.e., a list of lines). It should be easy for Pro owners to create a new class T2DPolygonFill using PrimitiveType.TriangleFan to produce a filled polygon. Might also be possible to expose the _material to put a texture on the triangles (not sure ablout that).Edit: I posted the code in the private forum. See www.garagegames.com/mg/forums/result.thread.php?qt=77768
Associate John Kanalakis
EnvyGames
John K.