I am loading a rigged collada file into SceneKit and trying to rotate the pelvis forward 45 degrees and spine. The pelvis and spine nodes do load, however, the rotation does not appear to work. The 2 SCNNode classes that are extracted are "joint" nodes in the dad file.
NSURL *url = [[NSBundle mainBundle] URLForResource:@"rigged-character" withExtension:@"dae"];
SCNSceneSource *source = [SCNSceneSource sceneSourceWithURL:url options:nil];
pelvis = [source entryWithIdentifier:@"ID179469248" withClass:[SCNNode class]];
spine = [source entryWithIdentifier:@"ID179691712" withClass:[SCNNode class]];
[pelvis setPivot:SCNMatrix4MakeRotation(MCP_DEGREES_TO_RADIANS(45), 0, 1, 0)];
[spine setPivot:SCNMatrix4MakeRotation(MCP_DEGREES_TO_RADIANS(45), 0, 1, 0)];
Does anyone know why and do I need to add: [myView.scene.rootNode addChildNode:pelvis]; [pelvis addChildNode:spine];
Thank you for your assistance.
In order to create the skeleton, I to build the skeleton as follows:
SCNView
loading in the collada fileSCNNode
from theSCNView.scene.rootNode
SCNView
's root node usingaddChildNode
Hope this helps!