# determining angular velocity

So, this is probably a kind of naive question and has a lot to do with my poor grasp of coordinate systems, but let’s say I’ve animated an airplane and would like to calculate its angular velocity about its coordinate frame. My naive approach would be to use the Slope CHOP to take the derivative of the rx, ry, and rz curves. This doesn’t really work, however, since Touch will represent a rotation any number of ways. For example, If I’ve animated my plane to have a yaw of -50 (ry = -50) and a pitch of -50 (rz = -50), Touch might represent this is as (42.4, 29.5, 61.7). Is there a way for me find the rotation about its frame in a way that I can then determine the velocity?

Thanks!
Michael
rotationQuestion.toe (3.97 KB)

I’m thinking about this too because I’d like to get the rotational velocity of a Vive hand controller based on its rx, ry, rz channels.

The first problem is that any of those rx ry rz channels will jump from 269 to -89 even though it rotated 2 degrees, so the slope chop doesn’t work right away.

So assume we’ve solved that issue and have a correct slope result. The resulting slope is like an Euler angle. My understanding of an Euler angle is that it’s three separate values for rotations on the three axes, and the fourth value is an instruction for which order to apply the rotations. I think the Object Chop and lots of other stuff will default to the order rx ry rz.

Now we’ve got our euler: github.com/mrdoob/three.js/blob … ler.js#L83

We can convert to Matrix4:
github.com/mrdoob/three.js/blob … x4.js#L153

We can convert to Quaternion:
github.com/mrdoob/three.js/blob … on.js#L107

Also from Quaternion we can convert it to an axis and an angle to rotate around that axis:
github.com/mrdoob/three.js/blob … on.js#L178
This last one is probably best for visualization and intuitive debugging.

I’ll try to post a tox once my stuff is better tested…

Edit:
My tox still isn’t working but I found some more links:
stackoverflow.com/questions/2215 … nions?rq=1
and the Angle CHOP has some quaternion features built in.