# Posts tagged ‘Matrix’

I tend to think in small chunks – I break down an idea, work out each part and then put it back together hopefully. I’m trying to use this approach with dynamics – I’m looking into a simple system to handle a variety of situations. Currently I’m thinking of simple spherical detection. This method use just a diameter from a point – its a simple system, but it might be scalable for more complexity.

Dynamics I find very hard to get to grips with, I have to take it very very slowly. Just understanding derivatives is hard, as its the function of the equation. Its also very fragile as a system – finite tweaks make big changes, especially in complex systems. My aim is to build simple systems that can be ‘bolted’ together right across the board from dynamics, to transformation stuff. Its sort of the middle man of rigging. I’m not the string or the parts of the puppet, im the knots that tie the string to the parts.

**Edit: My last post was more of a hinderance than a help, so i took it out.**

In my last post I discussed a possible way of doing animation pivots – it sadly was just notes in my book and spare of the moment ideas. I think i missed out a vital chunk, and i think in theory I can make it a little cleaner – weak referencing not needed.

So this is still theoretical, but if we examine a standard object matrix3 transform it contains the transform space and its pivot space i.e the offset to keep it in the right position. So if we essentially generalize this idea (i.e making itself over the top of itself) i think we can work it out.

A lot of people are confused by this, and in one sence its the software duping the user into thinking that there rotation, be it local or world is what it actually is. Rotations arent angles there either a collection of vectors from an origin or a vector and a twist as in angle axis or a quaternion – quaternions are slightly different in that they have two sets – imaginary in 4 dimensions and referenced in 3 dimensions. The twist i.e w of I, J, and K is part of the algorithm and cant be torn away.

The matrix is the easiest way to understand, imagine a graph in three dimensions 3 arrows one down the x, one down the y and one down the z. Now you derive three vectors, three points on the graph for each axis.

Now the length of the line from the origin [0,0,0] to each vector is the unit length, and by adding them all up should equal 1 – this is important and is also known as normalisation. Why is normalisation important well first off scale and rotation are linked in a matrix, scale I regard is a happy result of rotation. The normalised unit length being 1 means a scale of 100% 0.5 = 50% and so on – you can still get non-uniform scaling.

Now another import part is each vector, they have to be 90 degree from each other. Else what happens – well you get sheering, because scale is a result.

So in essence your defining an axis for the rotation, with three vectors from the origin like so:

([1,0,0], [0,1,0], [0,0,1] [0,0,0]) – the first three are you vectors to build your rotation, the last is position. Position is simple its just an offset from the origin.

Now another factor is the parent – transformations are relative to the parent. So if theres no parent then [0,0,0] position would be world center. Where as if it had a parent, [0,0,0] would be the parents pivot.

Euler is a bad way of representing rotations, because its really a system to make each vector x y z. Gimbal lock occurs because an axis after being evaluated, doesnt re-evaluate itself when the next is rotation. So when you rotate x 90, then y 90. Y is adding x – and so on and so forth. It means that once you get to z, your rotating x too because x has been rolled onto two axis.

One way to solve this is to project the axis into quaternions and re-evaluate the axis everytime you rotate it.

I was thinking today about skin simulation, and theorising what the key parts you need in a system – what you get for free and what costs. For one, sliding of the skin and volume transformations in world position space come for free. In my mind there result of the same system. What you dont get for free is rotation of the volume in world space, and tension of the skin i.e tickyness.

As firstly you need to store cached vectors, i.e a reference to a base set of vertexs. And these base set need essentially dynamic properties: whether there stationary or sticky about there world trasnform. Most system i take it need to cache a set of positions for the verts of the mesh to rely on, be it with normals or rays.

From writting, i can see a possibly viable solution to sliding and even transformations including world space rotations. You just need to transfrom the matrix of the vectors in an array of sorts. Sticky skin is tougher and even tougher still is what the skin does in the gaps, between the muscles under the skin. Ontop of this does it sag? jiggle? does skin weighting add to the result.

In my mind it should be one solution where you can decide either by paint ala ILM’s tool, whether the vert is sticking, slding or creasing.