我使用不要有明確命名節點的.POD文件,兒子,我不能用: CC3MeshNode meshNode =(CC3MeshNode)自getNodeNamed:@ 「節點名」];我怎樣才能得到所有從.POD文件節點Cocos3D
我想將.pod文件的全部內容存儲在meshNode中。 謝謝。
我使用不要有明確命名節點的.POD文件,兒子,我不能用: CC3MeshNode meshNode =(CC3MeshNode)自getNodeNamed:@ 「節點名」];我怎樣才能得到所有從.POD文件節點Cocos3D
我想將.pod文件的全部內容存儲在meshNode中。 謝謝。
我知道這是一個老話題,提問者現在可能已經得到了他的答案。但希望這將幫助其他人
[1] http://stackoverflow.com/questions/5271197/cocos-3d-pod-file-format-for-iphone-developing [1]
這是怎麼了我知道了,有了這個代碼替換您的初始化函數 ` - (無效){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]);
}`