ofMesh missing vertical lines in OpenGL ES

I am building something that basically deep copies a ofMesh from a Desktop and passes it to an RPi via TCP scokets

Everything seems to work ok until the RPi draws the mesh in wireframe mode. Here the vertical lines are missing



Desktop to Desktop everything is fine.
Changing the Renderer on the RPi doesn’t seem to change anything

I did have to put in a conditional to account for the differences in ofIndexType (basically casting an int to a short) otherwise I got bizarre results. I tried to use setupIndicesAuto when rebuilding the mesh but it didn’t work as well

Any clues?

surely I am going to say nonsense, there may be a correlation with the “ofPrimitiveMode” side RPI?

thanks - I actually did try that next (post screenshots)

they both report 0 with ‘getMode’ which I am pretty sure is OF_PRIMITIVE_TRIANGLES on both

just tried creating the mesh on the client side and still drawing weird so it’s not in my transfer process. appears to be a bug

this is just a limitation of openGL ES not supporting polygon mode. in desktop GL you can just set the polygon mode to GL_LINE and it’ll draw the wireframe of the mesh but in GL ES that’s not possible so when you ask to draw the wireframe OF internally just draws the mesh with primitive mode GL_LINE_STRIP which draws the triangles but doesn’t close them so the wireframe is not complete.

the solution would be to generate a wireframe mesh that represents the triangles correctly but it’s possibly something that should happen in the user code or as an explicit method in ofMEsh returning another ofMesh to signal that is a relatively expensive operation

1 Like

Thanks Arturo - good to know!