Search code examples
iosblendercocos3d

Cocos3D - Texture not displayed


I'm facing hard times trying to get the texture to work in Cocos3D. Here's what I've done.

STEP 1: Via MakeHuman, I created a male model with materials that includes jeans, hair and Tshirt.

STEP 2: I exported the Blender Exchange Tarzen.mhx file that include texture images.

STEP 3: Via Blender, I imported the Tarzen.mhx file and saved this workspace in the same directory as the texture images as Tarzen.blend. That allowed the Tarzen.pod file to symbolically points to the texture images path relatively.

STEP 4: Without any further changes to Blender, I exported the Tarzen.pod file. PVRShaman displays the model with all textures correctly.

STEP 5: I copied the Tarzen.pod and all texture images into xCode's resource folder and execute the code. Interestingly, only the skin color and hair color looks correctly but the jeans and TShirt always show up black.

Any idea why? Thanks.


Solution

  • "Without The" helped me resolved this issue by first remove the texture then added back in using the following code:

    CC3MeshNode * jeans = [rezNode getMeshNodeNamed:@"Bison:jeans01"];
    [jeans.material removeAllTextures];
    [jeans.material addTexture:[CC3Texture textureFromFile:@"jeans_basic_diffuse.png"]];