Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cocos 3D POD file format for iphone developing

I am new in cocos 3d developing.

I have used cocos-2d for iphone and ipad, in which we have to used .png file for UI.
But in this Cocos-3d programming, .POD file format have been used. I don't know about POD file format and how to access that node name from .POD file?

like image 907
RAVI Avatar asked Dec 05 '22 23:12

RAVI


2 Answers

You need to use some 3D software like Blender (Open Source), Maya or 3D Max to make some 3D objects and export it as DAE file format and by using Collada2POD translate this file to POD file format. Now you are ready to use Cocos3D. If it is complicated for you, ask another question in detail!

I hope it useful for you!

like image 57
Hamed Rajabi Avatar answered Dec 14 '22 06:12

Hamed Rajabi


I'm not sure about the Cocos3D implementation, but you can get at the node name via the CPVRTModelPOD class imgtec provides with their SDK.

CPVRTModelPOD model;
model.ReadFromFile("path/to/model");
for(int i=0; i<model.nNumMeshNode; i++) {
    SPODNode *node = &model.pNode[i];
    int mesh_idx = node->nIdx;
    printf("%d (%d): %s\n", i, mesh_idx, node->pszName);
}

All of the nodes (mesh, lights, camera, etc), are all together in that pNode list, but the mesh nodes will be grouped at the beginning.

I haven't looked into Cocos3D, but i'm assuming they use the code that imgtec distributes from here.

like image 38
joshfisher Avatar answered Dec 14 '22 07:12

joshfisher