They're 4D complex numbers. If you don't know what they are, you won't need them. They basicly work just like vectors actually...
I noticed the new quaternions section in the Expression 2 wiki, and did not know how to use them or exactly what they were. All I know is that they can be used in rotating things to beat gimbal lock I think. So I was wondering if anyone could make a tutorial on how to use them for rotating things.
Much appreciated,
Rich
They're 4D complex numbers. If you don't know what they are, you won't need them. They basicly work just like vectors actually...
I don't know how to use them myself, but perhaps this link can help.
[ame=http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation]Quaternions and spatial rotation - Wikipedia, the free encyclopedia[/ame]
It gets a little heavy in the middle, but don't give up: pseudocode for rotation operations is at the end.
Last edited by nescalona; 08-22-2009 at 07:36 PM.
Right now the quaternions can only be used to rotate vectors. To rotate a vector using a quaternion, you basically do:
VRotated = vec((Q*V)/Q)
Or, if Q is a unit quaternion (for example generated with qRotate):
VRotated = vec(Q*V*conj(Q))
That's basically all there is to do now, you can also perform basic arithmetic on quaternions, but it's not very useful.
I have an idea to make it possible to set holograms orientation with quaternions, just like it's done with angles, for example holoQuat(N,Q). It could be then used to animate holograms, as quaternions are easily interpolated using SLERP. What do you think?
My programs: BIOS - Alcyone - Calculator - Notepad - Movie Player
My tutorials: applyTorque - Quaternions - PID controllers
Some other things I made: FT Chip - RK4 Solar System
Bookmarks