any method for drawing arbitrary polyline/polygon?

does panda ever have any method for drawing arbitrary polyline/polygon in 2d/3d?

You can construct your own geometry out of triangles using low-level Panda tools, as described in the manual. You can also use the egg library to construct an arbitrary polygon in an egg file, and load it via loadEggData(), as discussed in various threads in the forum.

Can you be a little more specific about what you’re hoping to do?


OK. I am making a simple prototype for the drawing core of our GIS system. For a rapid prototyping, I wonder if the panda has some ready-to-use method for drawing arbitrary polygon and polyline in 2d/3d. In GIS, we could have lots of complex polygons with thousands of edges(and some polygons even have “holes” in them). By a 2d approach, we could draw those polygon and fill them directly, and map the 2d buffer to the 3d world. In a 3d approach, we need to triangulate the polygons and drawing them.

The egg library automatically handles triangulation of complex polygons, though I don’t think it handles holes.

You can also use the Triangulator class to facilitate triangulation of highly complex polygons. This class does support holes, though it doesn’t automatically create the geometry for you; you’ll still have to do that yourself.

If all you want is a polyline, there’s no triangulation required; you can simply create a GeomLines object, or use the higher-level LineSegs class.