Hi all !
How can I make simple Polygons ( f.ex. with 7 Points). Which Xith3D Function do I have to use for Polys? I can’t find one. ???
Hope you can help me…
Bye
“Cloudwalker”
Hi all !
How can I make simple Polygons ( f.ex. with 7 Points). Which Xith3D Function do I have to use for Polys? I can’t find one. ???
Hope you can help me…
Bye
“Cloudwalker”
To display a (filled) polygon, the easiest way is to create a triangle fan with the coordinates of the polygon.
I don’t know how to display a wireframe polygon
Vincent
To make a code for filled polygons is difficult, because in the case the polygon is not planar there will be lots of ways to fill it. The method Niwak suggest sounds good, but is only one way to triangalize the Polygon. Mhh. haven’t we got also a Triangalizer in Xith? Or is that only a tool i know from Java3D?
If you only want to draw lines I would suggest you’d use a LineArray.
Arne
Thanks Niwak…
But a Triangle Fan doesn’t help me … because i have concave polygons (which are more complex) too…
What can I do to display those Polys?
@arne I want to use filled Polys… I need to fill the Line Array
You can’t fill LineArrayS.
As I said the problem is very complex and I don’t have an idea - so try to google something out. Or you could try to look at the Java3D code. As far as I know they had such a tool.
There are different ways to handle concave polygons. What you need is a triangulation algorithm.
There are currently none in Xith.
If you do not have very big polygon (thousands of points) and have no big realtime needs, there is a simple algorithm you can use ;
This algorithm is very slow but it works and is very simple to implement.
If it does not meet your requirements, you have no other solution than either using Java3D but the triangulation algorithm in it is buggy and is covered by a copiright or implements one of the numerous algorithm availables on the web (a good one is the one used in GLUT, source code available from SGI).
Note that another (and far more effective) solution is to use the tesselator in GLUT. The counterpart is that the tesselator is only available through JOGL (not LWJGL as far as I know).
Vincent
Thanks very much Niwak…
I think triangulating the polygons will do it…
I will try to use the GLU Tesselation Function, because im using JOGL with Xith3D…(hope it works fine).

Bye
“Cloudwalker”