ofxassimpmodelloader - texture bug

hello,

my first steps towards 3D graphics…

i have a question concerning ofxassimpmodelloader:

the example works fine, looks good!
all of the 5 different models.
i’m using codeblocks 10.05 and of 007.

now, what i want to do should be quite simple:

i’d like to load my own meshs into the app…but it doesn’t work:

  • i have a simple cube (i’m using blender 2.49b) textured via uv-mapping.

  • then i export the cube to an obj. file using the blenderexportscript.

  • in the ofxassimpmodelloader example i get following result:

  • mesh is loaded correctly but the texture is not where it should be (attached pictured).
    it is strangely inversed.

-I exported my model in every possible format (.obj, .x, .3ds, .dae). .obj and .3ds show the result like above, .dae crashes the app and .x works with the mesh but
the texture is completely wrong.

-i tried to flip the uv-coordinates in blender, before exporting , but no right result

-i tried to flip the normals in blender, also no right result

-i checked the .obj in a .obj-model-viewer. it showed the right result, so the .obj-file should be ok.

strange thing about this is that i started with the 3dsmodelloader-example and got the bug introduced above. so i changed to the assimp-example…

I’m out of ideas right now…

would be nice if anyone knows this strange behavoiur :slight_smile:

thanks

oli

1 Like

handedness of OF is opposite a lot of other 3d environments because OF comes from a 2d background rather than 3d.

try changing the handedness by inverting your z axis before drawing the objects:

  
  
void testApp::draw() {  
  ofScale(1, 1, -1);  
  ... // draw objects  
}  
  

1 Like