Color issue with faces in GLMeshItem

98 views
Skip to first unread message

Michiel Cnossen

unread,
Mar 22, 2020, 4:55:44 PM3/22/20
to pyqtgraph
Hi Guy's,

I'm using pyqtgraph and opengl for the first time to make some 3d shapes. This has been going well so far, but I cant get the colors to be as I want.

You can see an screenshot of the shape(a tube) I have created below using pyqtgraph.opengl.MeshData. The faces get the color I want(light red in this case), but appear only on one side, I cant figure out how to change it on the other side(the outside of the tube). 
I don't really care about one side, as i'm going to make a closed shape and add a thickness to the tube wall. Currently I've only made a mesh for the outer radius of the tube, hence the color should be on the other side.

screenshot.png










Can somebody help me along? I think a general explanation on how to deal with this would be sufficient. This is probably a beginners mistake.

Thanks in advance!

Best regards, Michiel 








Kenneth Lyons

unread,
Mar 25, 2020, 9:28:09 PM3/25/20
to pyqtgraph
 How exactly are you constructing the mesh? A minimal reproducible example might be helpful. I think what's happening is the faces are created with vertices in the wrong order. See here for an explanation: https://www.khronos.org/opengl/wiki/Face_Culling#Winding_order
Reply all
Reply to author
Forward
0 new messages