首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >使用isgl3D时,3D对象中的纹理贴图(.pod)不能正确执行

使用isgl3D时,3D对象中的纹理贴图(.pod)不能正确执行
EN

Stack Overflow用户
提问于 2013-11-11 14:11:29
回答 1查看 708关注 0票数 70

我使用的是3DiPhone (.pod)模型,它在PVRShammon中可以正确显示。

但是当我将这个3D模型导入到isgl3D中时,它与纹理图像不能正确显示,图像只覆盖了物体的一些区域和一些线条和三角形。

代码语言:javascript
复制
_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:)];

欲了解更多信息,请查看图片。Output image in isgl3D view

EN

回答 1

Stack Overflow用户

发布于 2015-10-04 08:28:20

这只是我的两点意见。您的纹理是否遵循isgl3D要求?

来自isgl3D教程3-纹理贴图http://isgl3d.com/tutorials/4/tutorial_3_texture_mapping

对于标准图像文件,图像大小必须是两个兼容的因子:例如64x128、256x32等。对于

纹理,图像文件也必须是正方形:例如64x64、256x256等。

希望这能有所帮助。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19899938

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档