Explaining in Detail the ScnVector4 method

我是研究僧i 提交于 2019-12-05 18:20:59

I believe that your are trying to rotate nodes (rotation property).

From the documentation :

The four-component rotation vector specifies the direction of the rotation axis in the first three components and the angle of rotation (in radians) in the fourth.

You might find it easier to use eulerAngles :

The node’s orientation, expressed as pitch, yaw, and roll angles, each in radians

Use .transform to rotate a node

node.transform = SCNMatrix4Mult(node.transform, SCNMatrix4MakeRotation(angle, x, y, z))

if you want to rotate your node 180 degree by x axis

node.transform = SCNMatrix4Mult(node.transform, SCNMatrix4MakeRotation(Float(M_PI), 1, 0, 0))
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!