要求
我在 Blender 中创建了一个 3d 模型 - 每个面上都有数字 1 到 6 的立方体。我在每个面上添加了一个 UV 纹理来表示数字。当我在 Blender 上渲染它时,这些数字显示得很好。
我正在尝试使用 Cocos3D 将此模型导出到 iPhone。
规格
- iOS 6.1 和 Xcode 4.6.2
- cocos3d 0.7.0
- 搅拌机 2.67b
我做了什么
- 根据这个 官方文档,我将 PVRGeoPOD 转换器插件添加到 Blender。
- 在搅拌机中创建 3D 模型。使用默认的搅拌机立方体并在所有 6 个面上添加 UV 纹理。
通过在 Blender 中选择File->Export->PVRGeoPOD(.pod/.h/.cpp)生成一个 .pod 文件 。
将 pod 文件添加到 Cocos3D 默认模板项目中。更改代码以使用我的编号立方体文件而不是默认的“Hello world”文本。
[self addContentFromPODFile: @"numbered_cube.pod"];
添加了一个 3 轴旋转,以便我可以看到所有 6 个面。
CC3MeshNode* helloTxt = (CC3MeshNode*)[self getNodeNamed: @"Cube"]; CCActionInterval* partialRot = [CC3RotateBy actionWithDuration: 1.0 rotateBy: cc3v(40.0, 30.0, 30.0)]; [helloTxt runAction: [CCRepeatForever actionWithAction: partialRot]];
问题
嗯,立方体正在显示,它正在旋转。但是立方体上没有纹理。在日志中,我可以看到这个
从文件 numbered_cube.pod 构建 CC3PODResource,其中包含 3 个节点(1 个网格节点)、1 个网格、1 个摄像机、1 个灯光、1 个材质、0 个纹理、0 个帧、环境光
进一步的研究
I did some search and come across this SO thread. It tells about Collada (.dae) file, kind of intermediate file between .blend and .pod. When I tried to convert, I only got the .pod file. I then used File->Export->Collada(.dae) to create a .dae file manullay. Then I tried to convert this .dae file to .pod using PVRGeoPODGUI standalone tool. The file is successfully opening, but the export button is always disabled.
So simply, my problem is how can I show the textures in the 3D model I created in Blender in iPhone using Cocos3D. Any idea?