Drawing Line,Cube,etc....

Hello,…

Is there a function to draw a line by drawing vertices and connect between them to make a line or a cube or a triangle

Thanks in advance

panda3d.org/manual/index.php/GeomPrimitive

Here is a starting point.

If you just want to draw a line, you could look at the LineSegs class, it’s easier to use than GeomPrimitive. But if you want to construct solid geometry, you have to use GeomPrimitive, or at least EggData and related structures.

David

Ooooo, I was not aware of LineSegs either…

Thanks for replying…LineSegs is good and worked well with me…but what about GeomPrimitive and EggData?..they didn’t work with me and I can’t find a complete code for them

GeomPrimitive is a very complex way of creating geometry, but it’s fully powerful and robust (it’s the low-level geometry construction object that all geometry in Panda goes through). But because it’s complex, it can be difficult to use. There is a full section in the manual describing it in detail.

EggData is an interface to the egg library, which can be used to construct an in-memory egg file, which you can then load to geometry. It can be a bit easier to use than GeomPrimitive, because you only have to add vertices and polygons, without having to think carefully about connectivity and vertex formats and such. Unfortunately, there is no documentation in the manual about EggData, but there are several examples in the forums, and the generated API is complete.

David