0

I am trying to add a 3D human body model to my app using ISGL3D. I tried but somehow textures are not added properly on meshes. Here is my code and 3d model files. Can anyone please help me?

Here are 3d model and textures https://www.dropbox.com/s/7xcr3ytovifwblk/3D%20Objects.zip

And here is my code

_cameraController = [[Isgl3dDemoCameraController alloc] initWithCamera:self.camera andView:self];
    _cameraController.orbit = 300;
    _cameraController.theta = 30;
    _cameraController.phi = 30;
    _cameraController.doubleTapEnabled = NO;

    // Enable shadow rendering
    [Isgl3dDirector sharedInstance].shadowRenderingMethod = Isgl3dShadowPlanar;
    [Isgl3dDirector sharedInstance].shadowAlpha = 1;

    Isgl3dPODImporter * podImporter = [Isgl3dPODImporter podImporterWithFile:@"Male_Model.pod"];


    [podImporter buildSceneObjects];
Isgl3dShadowCastingLight * light  = [Isgl3dShadowCastingLight lightWithHexColor:@"FFFFFF" diffuseColor:@"FFFFFF" specularColor:@"FFFFFF" attenuation:0.00];
    light.position = iv3(300, 600, 300);
    [self.scene addChild:light];
Isgl3dTextureMaterial *textureMaterial2 = [[[Isgl3dTextureMaterial alloc] initWithTextureFile:@"25-OrmondAfter.jpg"
                                                                                        shininess:0.0
                                                                                        precision:Isgl3dTexturePrecisionHigh
                                                                                          repeatX:YES
                                                                                          repeatY:YES] autorelease];
    mesh = [podImporter meshAtIndex:0];
    node = (Isgl3dMeshNode*)[self.scene createNode];
    node = [node createNodeWithMesh: mesh andMaterial:textureMaterial2];
    node.position = iv3(0, -130, 0);;
    node.rotationY = 180;
    node.doubleSided = YES;
    [self.scene addChild:node];

    Isgl3dTextureMaterial *textureMaterial3 = [[[Isgl3dTextureMaterial alloc] initWithTextureFile:@"AM_Head_1k.bmp"
                                                                                        shininess:0.0
                                                                                        precision:Isgl3dTexturePrecisionHigh
                                                                                          repeatX:YES
                                                                                          repeatY:YES] autorelease];
    mesh = [podImporter meshAtIndex:1];
    node = (Isgl3dMeshNode*)[self.scene createNode];
    node = [node createNodeWithMesh: mesh andMaterial:textureMaterial3];
    node.position = iv3(0, -130, 0);;
    node.rotationY = 180;
    node.doubleSided = YES;
    [self.scene addChild:node];

    Isgl3dTextureMaterial *textureMaterial4 = [[[Isgl3dTextureMaterial alloc] initWithTextureFile:@"spin_prod_695288001.jpg"
                                                                                        shininess:0.0
                                                                                        precision:Isgl3dTexturePrecisionHigh
                                                                                          repeatX:YES
                                                                                          repeatY:YES] autorelease];
    mesh = [podImporter meshAtIndex:2];
    node = (Isgl3dMeshNode*)[self.scene createNode];
    node = [node createNodeWithMesh: mesh andMaterial:textureMaterial4];
    node.position = iv3(0, -130, 0);;
    node.rotationY = 180;
    node.doubleSided = YES;
    [self.scene addChild:node];

    Isgl3dTextureMaterial *textureMaterial5 = [[[Isgl3dTextureMaterial alloc] initWithTextureFile:@"Joe-Fresh-Studded-Boots3.jpg"
                                                                                        shininess:0.0
                                                                                        precision:Isgl3dTexturePrecisionHigh
                                                                                          repeatX:YES
                                                                                          repeatY:YES] autorelease];
    mesh = [podImporter meshAtIndex:3];
    node = (Isgl3dMeshNode*)[self.scene createNode];
    node = [node createNodeWithMesh: mesh andMaterial:textureMaterial5];
    node.position = iv3(0, -130, 0);;
    node.rotationY = 180;
    node.doubleSided = YES;
    [self.scene addChild:node];

    Isgl3dTextureMaterial *textureMaterial6 = [[[Isgl3dTextureMaterial alloc] initWithTextureFile:@"hand-texture.jpg"
                                                                                        shininess:0.0
                                                                                        precision:Isgl3dTexturePrecisionHigh
                                                                                          repeatX:YES
                                                                                          repeatY:YES] autorelease];
    mesh = [podImporter meshAtIndex:4];
    node = (Isgl3dMeshNode*)[self.scene createNode];
    node = [node createNodeWithMesh: mesh andMaterial:textureMaterial6];
    node.position = iv3(0, -130, 0);;
    node.rotationY = 180;
    node.doubleSided = YES;
    [self.scene addChild:node];

    Isgl3dTextureMaterial *textureMaterial7 = [[[Isgl3dTextureMaterial alloc] initWithTextureFile:@"hand-texture.jpg"
                                                                                        shininess:0.0
                                                                                        precision:Isgl3dTexturePrecisionHigh
                                                                                          repeatX:YES
                                                                                          repeatY:YES] autorelease];
    mesh = [podImporter meshAtIndex:5];
    node = (Isgl3dMeshNode*)[self.scene createNode];
    node = [node createNodeWithMesh: mesh andMaterial:textureMaterial7];
    node.position = iv3(0, -130, 0);;
    node.rotationY = 180;
    node.doubleSided = YES;
    [self.scene addChild:node];
[self schedule:@selector(tick:)];

Please help me. I am really stuck.

Best Regards

Aqueel
  • 1,246
  • 3
  • 23
  • 46

1 Answers1

0

I checked your model with PVRShaman and it seems like your normal setting is flip while you export from your 3D application.

Go read this and explore the setting. Most probably is the 3D setting issue.

sooon
  • 4,718
  • 8
  • 63
  • 116