I'm new in Cocos3D and I have two questions concerning the parts of the 3D model.
As I understood, a .POD file consits of several parts. In my example, I have a 3D Car, which has the parts: - wheel - tire - class (etc.) and these parts have submeshes. I see this, when I open the pod file with PVRShaman.
Now my questions:
Is it possible for me to have access to these parts? E.g. I want to change the color of the wheel. Can I do this programmatically?
When I tap on a part, I want to know, on which part I have tapped. E.g. I want to tap on the wheel, and I know, that the wheel was selected. How can I do this?
Thank you very much!
Update: after the second proposal, my method looks like this:
-(void) nodeSelected: (CC3Node*) aNode byTouchEvent: (uint) touchType at: (CGPoint) touchPoint {
NSLog(@"Node selected: %@", aNode.name);
CC3Ray touchRay = [camera unprojectPoint: touchPoint];
CC3NodePuncturingVisitor* puncturedNodes = [self nodesIntersectedByGlobalRay: touchRay];
// The reported touched node may be a parent. We want to find the descendant node that
// was actually pierced by the touch ray, so that we can attached a descriptor to it.
CC3Node* localNode = puncturedNodes.closestPuncturedNode;
NSLog(@"Node local: %@", localNode.name);
}