With bone-skinning, the bones deform the location of the mesh vertices of a mesh node away from their rest locations in their mesh node. The location of the vertices therefore become a combination of the location of the bones and the mesh node.
In your app, you rotate the arm by rotating the root bone. The result is to rotate both the skeleton and the mesh nodes that hold the mesh vertices, and each is rotated relative to its rest position. The effect is to rotate the visible vertices at a rate twice that of the bone, because both the rotated bone and mesh node transforms are affecting the position of the vertices.
You can see what I mean by adding the following line to the
`[[self getNodeNamed: @"Arm.001"] addAxesDirectionMarkers];`
This will draw axes indicators for the
ARM.001 bone. You'll see it rotating at a different rate than the visible components of the arm. Try invoking this method on several of the other components of the model, and you'll start to get a picture of how rotating a bone affects things.
You can fix this by rotating the entire
CC3SoftBody node that wraps your model. In your scene, it is called
Particle_Anim.pod-SoftBody. This will rotate the entire bone & skin assembly as a unit, and will also rotate the rest-pose locations as well (which are determined relative to the soft-body node.
You can use
addAxesDirectionMarkers on the soft-body node to determine its axes directions, which has the Y-axis pointing up, so you'll need to rotate this node around the Y-axis, instead of the Z-axis.
CC3SoftBody node is special in that the deformation between the rest-pose of the mesh and the deformed mesh, as it is affected by bones, is determined relative to the status of the
CC3SoftBody node. In general, you want to either move the soft-body node so that the entire model (and its rest-pose) moves, or you want to move the bones without moving the mesh nodes, so that the bones deform the vertices relative to their rest positions in the mesh node.
Looking ahead, if you want to be able to move the individual components of the arm, make sure your model is constructed so that moving any bone does not move any mesh node. In other words, try to separate the bone skeleton from the mesh node structures. They should come together at the soft-body node.
Finally, if your model is not flexible and deformable (like a human character, grass, or a flag), there's no need to use bones to control the model. You can simply chain together a series of rigid
CC3MeshNodes into an assembly, and rotate and move them individually to create motion in the robot arm. That's the way the robot arm in
CC3DemoMashUp is constructed, and it greatly simplifies both your control logic, and rendering.