openFrameworks-RaspberryPi / openFrameworks

This repo has migrated into the openFramworks core! Please go to http://github.com/openFrameworks/openFrameworks for the latest!
http://github.com/openFrameworks/openFrameworks
Other
104 stars 11 forks source link

issue in pointPickerExample: bunny.ply looks weird. #99

Open kalwalt opened 11 years ago

kalwalt commented 11 years ago

hi @bakercp ,as you asked me here #94 i break that issues in more and specifics issues. This issue happens in pointPickerExample. The mesh does not seems to be rendered correctly. See the picture below.I used GLES1 in this case. Using GLES2 the mesh is no longer visible, I just get black screen(faded) with graphics strings (i omitted the image because there is no reason to show it). During the compilation of the code and at launch the application does not receive any error. Probably the vertices are interpreted in a different way but i'm not gone deeper to solve the cause. I think that the ability to load a mesh is fundamental, until we have assimp3.0. I still have to go back to 3dmodelloader and to see how to solve some problems.

pointPickerExample GLES1- 04012013 - 12:46:03

bakercp commented 11 years ago

@kalwalt thanks for breaking these issues up into smaller pieces. I know it takes some time, but it makes it a lot easier to view squash the bugs. Thanks!

kalwalt commented 11 years ago

@bakercp i noticed that some examples works with GLES1 other with GLES2 and viceversa. Does have sense to open specific issue for that? or does it better to prepare a list table summarizing which are working in GLES1 or GLES2?

arturoc commented 11 years ago

i think that's ok, some classes like ofLight or ofMaterial don't work with gles2 and probably won't since there's other methods of doing those things in modern opengl. shaders are not supported in gles1. i think it's just a matter of adding the right renderer for each example. and for those examples that work with both let the default renderer which right now is gles1

danzeeeman commented 11 years ago

Tthis is a gles2 thing. I think I've seen this before when loading 3D files and the gles2 settings you pick. You can get some really interesting shapes. I'll look into it.

danzeeeman commented 11 years ago

So I think this is an issue with the mesh.drawWireframe(). It looks like we aren't correctly drawing the verts as GL_LINES in the correct order, which is why you are seeing the lines drawing every which way. So some people suggest you force it to draw in triangle by doing this:

for(int i = 0; i < vertexData.getNumVertices(); i+=3){
     glDrawArrays(GL_LINE_LOOP, i, 3);
}

but this expectes the verts array to be in the correct order already. So I think this isn't loading the verts in the right order.