خرید بک لینک

Vote count: 0

I have a SCN Node that I have Transformed to a desired Rotation and Angle.

I now what to rotate it infinitely on it's new x-axis, but I can't seem to get it to rotate 360 degrees, it just shifts slighty.

let spin = CABasicAnimation(keyPath: "rotation")
spin.fromValue = NSValue(SCNVector4: SCNVector4(x: item.rotation.x, y: item.rotation.y, z: item.rotation.z, w: item.rotation.w))
spin.toValue = NSValue(SCNVector4: SCNVector4(x: Float(2*M_PI), y: item.rotation.y, z: item.rotation.z, w: item.rotation.w))
spin.duration = 3
spin.repeatCount = .infinity
item.addAnimation(spin, forKey: "spin around")

Note I found the rotation code from an earlier question, and it works as expected, but not if I want to rotate on the transformed node.

asked 2 mins ago

برچسب: نویسنده: استخدام کار تاريخ: جمعه 20 فروردين 1395 ساعت: 9:25

صفحه بندی