如何从Cocos3D中的.pod文件获取所有节点

时间:2012-07-12 20:47:10

标签: iphone ios 3d cocos3d

我正在使用的.pod文件没有明确命名的节点,我不能使用的儿子: CC3MeshNode meshNode =(CC3MeshNode )[self getNodeNamed:@“NodeName”];

我想将.pod文件的完整内容存储在meshNode中。 感谢。

2 个答案:

答案 0 :(得分:0)

我知道这是一个老话题,提问者现在可能已经得到了答案。但希望这会有助于其他人

[1] http://stackoverflow.com/questions/5271197/cocos-3d-pod-file-format-for-iphone-developing [1]

答案 1 :(得分:0)

这就是我得到它的方法,用这段代码替换你的初始化函数 ` - (void)initializeScene {

CC3Camera* cam = [CC3Camera nodeWithName: @"Camera"];

cam.location = cc3v( 0.0, 0.0, 0.6 );

[self addChild: cam];

CC3Light* lamp = [CC3Light nodeWithName: @"Lamp"];
lamp.location = cc3v( -2.0, 0.0, 0.0 );
lamp.isDirectionalOnly = NO;
    [cam addChild: lamp];




CC3PODResourceNode *testBox = [CC3PODResourceNode nodeWithName:@"obj"];

testBox.resource = [CC3PODResource resourceFromFile: @"angry4.POD"];

[self addChild:testBox];





[testBox getNodeNamed: @"obj"].visible = YES;


testBox.touchEnabled = YES;

[testBox setRotation:cc3v(100, 0, 0)];

testBox.location = cc3v(0.0f, 0.0f, 0.0f);

[testBox setScale:cc3v(0.5,0.5,0.5)];


CCActionInterval* LCLoop = [CC3Animate actionWithDuration: 4.1];

 [testBox runAction:[CCRepeatForever actionWithAction:LCLoop]];

[self createGLBuffers];
[self selectShaderPrograms];
[self createBoundingVolumes];

LogInfo(@"The structure of this scene is: %@", [self structureDescription]);

}`