Using SceneKit on Mac OS X to load a COLLADA (DAE) file you can easily obtain all geometry by traversing the tree of SCNNode:s and their respective SCNGeometry:s, and extract the vertex data using [geometry geometrySourcesForSemantic: SCNGeometrySourceSemanticVertex].
However, given a DAE file containing an animated object - is SceneKit capable of giving me the exact location of each vertex at a given time in the animation, or can I extract all the animation data from the associated CAAnimation objects?
My use case is that I would like to use SceneKit to import DAE files, but use my own render pipeline for everything else.
Clarification There are obviously two methods how this could be accomplished:
1) Obtain and parse the key frames from the associated animation
2) Let SceneKit evaluate the scene for a given time, and give me pre-calculated vertex (etc) coordinates
What I was aiming for in my use case was #2, but if I can find documentation of the key frame format used by SceneKit #1 is also acceptable.
My problem is that for #1 I don't manage to dig any further than the following:
SCNNode.animationKeys gives animation keys available for a given SCNNode, [SCNNode animationForKey:key] given CAAnimationGroup objects from which CAAnimation objects are obtained through CAAnimationGroup.animations. The CAAnimation objects are (for my DAE files) in reality instances of CAKeyframeAnimation, from which I get CAKeyframeAnimation.values:
Keyframe (1 / 40): <00000000 0000f0bf 00000080 d9956d3c 000000a0 0e32a13c 00000000 00000000 00000020 636772bc 00000020 2914ef3f 00000000 0f7ecebf 00000000 00000000 00000020 1324a1bc 00000000 0f7ecebf 00000020 2914efbf 00000000 00000000 00000000 00000000 000000c0 205c6d40 00000000 00a069c0 00000000 0000f03f>
etc.. So to solve the #1 approach above I would need to find the format used for these key frames.
currentTime
. If you change it, does that update the geometry for you? – David Rönnqvist