Ios 使用isgl3D时,3D对象(.pod)中的纹理映射未正确发生

Ios 使用isgl3D时,3D对象(.pod)中的纹理映射未正确发生,ios,objective-c,3d,texture-mapping,isgl3d,Ios,Objective C,3d,Texture Mapping,Isgl3d,我使用了一个3D iphone(.pod)模型,它在PVRShammon中正确显示 但是,当我将该3D模型导入到isgl3D中时,它没有正确显示纹理图像,图像仅用一些线和三角形覆盖对象的一些区域 有关更多信息,请查看图片。 这只是我的两分钱。您的纹理是否符合isgl3D要求 来自isgl3D 教程3-纹理贴图 对于标准图像文件,图像大小必须是两倍 兼容:例如64x128、256x32等。对于pvr纹理,图像文件 也必须是正方形:如64x64、256x256等 希望这有帮助。您尝试过PVR图

我使用了一个3D iphone(.pod)模型,它在PVRShammon中正确显示

但是,当我将该3D模型导入到isgl3D中时,它没有正确显示纹理图像,图像仅用一些线和三角形覆盖对象的一些区域



有关更多信息,请查看图片。
这只是我的两分钱。您的纹理是否符合isgl3D要求

来自isgl3D 教程3-纹理贴图

对于标准图像文件,图像大小必须是两倍 兼容:例如64x128、256x32等。对于pvr纹理,图像文件 也必须是正方形:如64x64、256x256等


希望这有帮助。

您尝试过PVR图像而不是JPEG吗?您在哪里对纹理进行uv贴图?是否确实在没有纹理贴图的情况下正确显示对象(因此在使用isGL“非纹理”材质渲染时)?从屏幕截图上看,问题似乎与纹理无关,更像是isGL3D在从.pod文件加载顶点索引时会出现错误。您是否能够使用isGL3D成功加载和显示其他.pod文件?是否初始化网格和节点对象?另外,是否有理由只在索引4处开始网格?我会试试:[podImporter buildSceneObjects];网格=[podImporter meshAtIndex:0];节点=[node createNodeWithMesh:mesh和Material:textureMaterial2];node.position=posVar;node.rotationY=180;node.doubleside=是;看看纹理,我认为顶点格式在组件数量方面设置不正确。uv都是混合的,并且只有一些多边形渲染这一事实通常意味着其他多边形的法线被翻转(因此背面被剔除)。如果uv和法线的浮动顺序和数量不正确,或者着色器没有正确使用所有字段,则仍然可以渲染某些内容。“您的纹理是否符合isgl3D要求?”--此类问题应该在注释中,抱歉将其放入答案中。
_cameraController = [[Isgl3dDemoCameraController alloc] initWithCamera:self.camera andView:self];
_cameraController.orbit = 10;
_cameraController.theta = 20;
_cameraController.phi = 0;
_cameraController.doubleTapEnabled = NO;


Isgl3dPODImporter * podImporter = [Isgl3dPODImporter podImporterWithFile:@"iPhone5Spod.pod"];
[podImporter printPODInfo];
[podImporter buildSceneObjects];


Isgl3dTextureMaterial *material2 = [[[Isgl3dTextureMaterial alloc] 
                                         initWithTextureFile:@"DiffuseBody2.jpg"  
                                         shininess:0.0  
                                         precision:Isgl3dTexturePrecisionHigh  
                                         repeatX:YES  
                                         repeatY:YES] autorelease];


mesh2 = [podImporter meshAtIndex:4];
node2 = [self.scene createNodeWithMesh: mesh2 andMaterial:material2];
mesh2.normalizationEnabled = YES;
node2.position = iv3(0, 0, 0);
node2.rotationY = 180;
[podImporter addMeshesToScene:self.scene];


Isgl3dLight * light  = [Isgl3dLight lightWithHexColor:@"FFFFFF" diffuseColor:@"FFFFFF" specularColor:@"FFFFFF" attenuation:0.000];
light.lightType = DirectionalLight;
[light setDirection:-1 y:-1 z:0];


[self setSceneAmbient:[Isgl3dColorUtil rgbString:[podImporter ambientColor]]];
[self schedule:@selector(tick:)];