YassminAbdallah / iphonewavefrontloader

Automatically exported from code.google.com/p/iphonewavefrontloader
0 stars 0 forks source link

Using Cinema4D exported OBJ files cause texturing problem #18

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Export your textured mesh from Cinema4D using the Wavefront Exporter
2. Load it into your app using the WavefronOBJ loader
3. The r- and s-values seem to be flipped which causes the renderer to repeat 
the left-most row 
of your texture all over the polygon (since r, which is mostly 0.0, is used as 
the s-value).

What is the expected output? What do you see instead?
Texture coords would have to be added in the right order.

Please provide any additional information below.

When working with Cinema4D you will have to alter the following lines to get 
things working:

Replace the texture coord assignments inside the processOneVertex function (in 
OpenGLWavefrontObject.m) with this line:

textureCoords[(vertexNode->actualVertex * componentsPerTextureCoord) + i] = 
allTextureCoords[(vertexNode->textureCoords * componentsPerTextureCoord) + i] ;

Be aware that there are two occurences (in my case they're in line 33 and 44)!

This will cause the texture coordinates to be assigned in the order they appear 
in your 
Cinema4D OBJ export.

Original issue reported on code.google.com by stk...@gmail.com on 6 Feb 2010 at 12:01

GoogleCodeExporter commented 9 years ago
Eww, I should have changed the issue-type as this isn't really a Defect but an 
anomaly in Cinema4D's Wavefront 
exporter.

Original comment by stk...@gmail.com on 6 Feb 2010 at 12:03