How can I calculate a multi-axis SCNVector4 rotation for a SCNNode?

后端 未结 4 489
栀梦
栀梦 2021-01-14 10:18

The SCNNode take a rotation using a SCNVector4, which has an angle (w) and a magnitude how that angle applies to each axis (x, y, z). For example, to rotate 45

4条回答
  •  庸人自扰
    2021-01-14 10:46

    You'll need to generate an SCNVector4 for each of the rotations, and then multiply them. Note that the order of operations matters!

    http://www.cprogramming.com/tutorial/3d/rotationMatrices.html has a pretty good writeup of the math. Any OpenGL reference that deals with rotation matrices is worth a look too.

提交回复
热议问题