Posts Tagged ‘arcball’

h1

quaternions, I can make them work!

September 23, 2008

Now that I have arc ball working, I will show you what a quaternion is.  I have a couple of screenshots too, and they are here:

It looks like this initially.

It looks like this initially.

Now we've grabbed the arcball at the center.  The white circle represents the sphere in 4D hyperspace, and the red point is the point on the sphere we've grabbed.

Now we have a white circle showing us the grabable sphere of the arcball. The red point is where we've grabbed it.

As we've dragged the red dot, notice how what we've really done is simply dragged that point over on the arcball, and as the point is dragged, so rotates the sphere, and as the sphere rotates, so does the model.

As we've dragged the red dot, notice how what we've really done is simply dragged that point over on the arcball, and as the point is dragged, so rotates the sphere, and as the sphere rotates, so does the model.

Basically what a quaternion is is a 4 dimensional vector that exists in space over the real numbers.  For the purposes I use it for (rotation) it’s basically is superior, because it can do perfect great circle rotation easily.  The reason is that it isn’t constrained by the Euler representation’s axes (pitch, yaw, roll) which make the question of arbitrary axis smooth rotation much harder.  You have to do something like 3 different space transforms in order to do the rotation, and then you have to go back.  Whereas a quaternion essentially produces an imaginary axis that can rotate as though there were no space transform, because the other elements of the vector are relativistic.  It is very hard to imagine what this looks like, because it’s, you know, hyperspace.  Once the rotation operation has been derived through all that complex imaginary number crap, though, all the imaginary elements are gone, so nothing special is needed for the algorithm.  This wiki page has info on quaternions, and this NeHeGL example is a good demo of how it works.

h1

epic tabbing + floculate

September 22, 2008

I’m still trying to get arcball rotation to work, but in the meantime, I’ve finished my guitar tableture for this peice I’ve been working on.  I still don’t know how to embed the sheet on wordpress though.  Sigh.