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 に答える