I was looking for a clue to this since 2 days without a luck.
Basically, I want to animate rotation of a node in Scenekit but around one axis. Something like A door opening animation.
The thing is when I rotate it, it rotates from the middle, not from the side of the door as needed. Here's an example code of what I was trying to do:
let oldTransform = node.transform
let rotation = SCNMatrix4MakeRotation(Float(-Double.pi / 2.0), 5.0, 0.0, 0.0);
SCNTransaction.begin()
SCNTransaction.animationDuration = 1.5
node.transform = SCNMatrix4Mult(rotation, oldTransform)
SCNTransaction.commit()
Any hint on what I should do I will be really grateful. I'm new to Scenekit, hopefully you guys would understand that.