Shared by on 2019.01.14 13:39

Rotations have perplexed me for ages but I think I'm getting closer to understanding the rudimentaries. Why are there no 4d/quaternion examples included anywhere?

In the long run I want to be able to have a 'snake' which follows a 3d point and always keeps facing in the right direction. Can anyone help with that?

Currently if I add a z position into the rotation it all goes awry.

+0
Interesting
+1
+0
Unique

AttachmentSize
13.82 KB

## Tested with

Vuo version:
OS version:

### Here are some discussions

Here are some discussions with examples: Calulating a circular movement of a light-source and How to rotate an object towards another object?.

The data going into the Rotation port of `Make Quaternion Transform` should come from a `Make Quaternion from Vectors` or `Make Quaternion from Angle` node.

Does the attached composition do what you want? I'm not sure which direction is the "right direction".

### Thanks Jaymie, that helps a

Thanks Jaymie, that helps a bit. Guess I should have said correct direction, to follow the point. I made it work in the same manner with the Kinect/NImate (which outputs a quaternion anyway).

I don't understand why the first vector in Make Quaternion from Vectors is 1,0,0.

I also don't know how to use a 4d point to begin building a structure of vertex as in the shaft of the Rotating Arrow comp I shared, so that I can replace the cubes with a 'snake'.

### So I think I'm just about

So I think I'm just about understanding quaternions now and have created my first snake using 'correct' rotations. See attached, it uses Right_hand from the kinect in NImate or click the mouse and it uses waves and noise to drive the transforms. Uses stv.generate circle to make the initial points.

Very happy to have finally achieved this as it's something I was trying to get my head around years ago with Qtz.

### Really learning something

Really learning something here ! Had the question in my mind for some time too regarding how to rotate an abject an have it face it correctly !

Thanks !