Filled Polygons in TView3D

Dear all,

I try to display a surface mesh, which I created with another program, inside TView3D with Root. The displaying is working fine, but unfortunetly the result is looking a little bit unclear since one can look through the mesh. Because this will a surface plot, I was thinking to fill the polygons, which consist of three nodes, with a specific colour, but with TPolyLine3D, which I use, it is not working as I found out. Is there any other possibility to plot filled polygons inside a 3D window?

Thank you very much in advance!

Kind regards


There no filled 3D polygon in g3d:

$ ls graf3d/g3d/src
TAxis3D.cxx		THelix.cxx		TPointSet3D.cxx		TTRD2.cxx
TBRIK.cxx		TMarker3DBox.cxx	TPoints3DABC.cxx	TTUBE.cxx
TCONE.cxx		TMaterial.cxx		TPolyLine3D.cxx		TTUBS.cxx
TCONS.cxx		TMixture.cxx		TPolyMarker3D.cxx	TView3D.cxx
TCTUB.cxx		TNode.cxx		TRotMatrix.cxx		TXTRU.cxx
TELTU.cxx		TNodeDiv.cxx		TSPHE.cxx		X3DBuffer.c
TGTRA.cxx		TPARA.cxx		TShape.cxx
TGeometry.cxx		TPCON.cxx		TTRAP.cxx
THYPE.cxx		TPGON.cxx		TTRD1.cxx

May be you should try TGeo ?

[quote=“supermeisi”]Dear all,

I try to display a surface mesh, which I created with another program, inside TView3D with Root. The displaying is working fine, but unfortunetly the result is looking a little bit unclear since one can look through the mesh. Because this will a surface plot, I was thinking to fill the polygons, which consist of three nodes, with a specific colour, but with TPolyLine3D, which I use, it is not working as I found out. Is there any other possibility to plot filled polygons inside a 3D window?

Thank you very much in advance!

Kind regards[/quote]

If you have a mesh built from triangles, you can
have a look at: root.cern.ch/gitweb?p=root.git;a … cc1a364412

(it’s in $ROOTSYS/tutorials/eve/triangleset.C)

You have to somehow convert your mesh first: in this concrete example the input is a file (if I understand correctly):

NVertices MTriangles
x1 y1 z1
x2 y2 x2

xN yN zN
i1 i2 i3

where i1 i2 i3 etc. - describe the order in which you connect vertices to make a triangle (I guess, they
must be connected counter-clockwise).

Also have a look at root.cern.ch/gitweb?p=root.git;a … cc1a364412

  • instead of using file you can create TEveTriangleSet directly, setting the vertices and triangles as it’s done in TEveTriangleSet::ReadTrivialFile:

root.cern.ch/gitweb?p=root.git;a … cc1a364412