Cube Snake to try and Understand 4d and Quaternions

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.

Cube Snake Understand 4d and Quaternions.vuo (13.8 KB)

Screen Shot 2019-01-14 at 18.38.45.png

1 Like

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”.

Cube Snake Understand 4d and Quaternions 2019-01-19.vuo (14.6 KB)

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 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.

Triangle Snake Kinect.vuo (23.1 KB)

Here’s a little video of the newest incarnation
I made three different ‘snakes’, triangle, square and circle as the basis.

1 Like

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 !

1 Like