0

我正在尝试使用 ISGL3D 将 3D 人体模型添加到我的应用程序中。我尝试过,但不知何故纹理没有正确添加到网格上。这是我的代码和 3d 模型文件。谁能帮帮我吗?

这是 3d 模型和纹理 https://www.dropbox.com/s/7xcr3ytovifwblk/3D%20Objects.zip

这是我的代码

_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:)];

请帮我。我真的被困住了。

此致

4

1 回答 1

0

我用 PVRShaman 检查了您的模型,当您从 3D 应用程序导出时,您的正常设置似乎是翻转的。

去阅读这个并探索设置。很可能是3D设置问题。

于 2013-06-29T02:46:10.190 回答