Forget about trying to keep students' attention. Forget about getting to the good stuff quickly. If you're serious about rigging, before you even touch a 3d package, I believe everyone should have a good grasp of vectors.
Unless you already understand vectors in which case, grab that 3d package! With both hands!
Don't worry, vectors aren't that crazy.
I'll assume you're familiar with this:
This is what's known as a Cartisian Coordinate Plane. Named after extraordinary mathematician and mediocre philosopher Rene Descartes.
Two dimensions, one, the horizontal arbitrarily described by the letter 'x', and the vertical described by the letter 'y', measured simply in "units", which can be a stand-in for whatever unit of measurement is relevant to your needs.
Very useful for breaking down 2d space into a relationship between two 1d spaces.
Something of note: on this plane, the co-ordinate (0, 0) (that's 0 on the x axis and 0 on the y axis) has a special name - the 'origin'. You might have heard the centre of the world inside Maya referred to by that name. It's not a Maya thing, it's a math thing. Even in 3d space, like in a 3d software package, the centre of the 3d coordinate plane (0, 0, 0) is called the 'origin'.
Now onto vectors.
Let me ask you something. Say I'm standing in a field, at the origin (0, 0) - and say I throw a ball. Can you tell me where it comes to rest?
No, you know what? Not a ball. A brick! So it won't bounce. Where it lands is where it will stay. No bounce factor. Nice and simple.
So where will the brick land?
Obviously you can't tell me. You need to know "How far did you throw it?"
Well played.
So suppose I threw it 4 units. That's the length of 4 squares on the coordinate plane. I'm stood at (0, 0), and I throw the brick 4 units.
Now can you tell me where it landed?
With this info, the best you can do is tell that it landed somewhere on edge of this circle:
What I gave you - just the distance I threw it - is what's called a 'scalar'.
What you need to figure out the brick's landing position is what's called a 'vector'.
A vector is a kind of number. It's a number that possesses both 'magnitude' and 'direction'.
A scalar on the other hand is a number that only has magnitude. Most numbers in day to day life are scalars.
Magnitude refers to the size of a number, if you like. The magnitude of the number 7 is 7. The magnitude of the number -7 is also 7. If on top of that you ask "Yeah, but 7 in which direction? Positive or negative?" now you're asking for the direction. You're asking for a vector, not a scalar.
An example of a scalar is 20 kilometres.
An example of a vector is 20 kilometres east.
So let me give you the direction in which I threw that cursed brick.
I threw it to the left (that's your left.)
So I've provided the magnitude, and the direction. Both of those things together form a vector. 4 units to your left. Now you have everything you need to deduce where the brick landed:
So in this nightmarish existence, I can only throw the brick in two directions: Forwards or backwards. Right or left. Positive or negative. However you care to describe it.
If I threw the brick say, 6 units, you still couldn't tell where it landed unless I also tell you the direction.
Simple everyday numbers like 1, 2, 4, -9, 15.6, -2948.3333, etc. in a context where there are positive and negative numbers, can be thought of as 1d vectors. They have a magnitude, and their sign (positive or negative) is the direction.
So back to the 2d plane. I could throw the brick left, or right, or up, or down.
But hang on... what if I threw it in such a way that it lands here:
Welp! I guess vectors are useless after all. Pack it up people! Pack it up!
No, if course there's a way.
See, this vector's direction seems to go left by some amount and it does up by some amount. So both the x and y axes are relevant. It's a vector in two dimensions.
Technically the earlier examples were 2d vectors as well, because they were happening in a 2d plane. They always had the potential to go in any direction, up, down, left, right, or indeed the arbitrary direction we're currently dealing with.
Because of that, the standard is to break a 2d vector into two 1d vectors. One for the horizontal X axis, and one of the vertical Y axis.
Allow me to demonstrate:
So that's -4.1 in the X
and 2.87 in the Y
The usual way of writing this down is like this: (-4.1, 2.87)
I guess because 'x' comes before 'y' in the alphabet we all just agree that the first number describes the X vector and the second number describes the Y vector.
So with these two numbers, we can express a vector with any arbitrary direction. If I told you the brick landed at (3, -2.5), that would mean it landed 3 units to right of the origin and 2.5 unit bellow the origin. So there's only one possible place it could have landed:
So we have everything we need to describe it's landing position accurately.Joyous day!
And treating the two 1d vectors as two sides of a right triangle, and treating the trajectory from the origin to the brick's landing position, as the hypotenuse, figuring out the distance it traveled in any arbitrary direction is just a matter of using the trusty old Pythagorean theorem:Okay, we've seen 1d vectors and 2d vectors. What's an example of 3d vectors?
Well the viewport of a 3d graphics program is a perfect example!
Maya's world is mapped in 3d space, so it has an X axis, a Y axis, and it has a third called the Z axis. And any point anywhere in this environment can be described as a vector from the origin (0, 0, 0) to that point. A 3d vector.
And as you might have guessed, we express 3d vectors by breaking them down into three 1d vectors. An X vector, a Y vector, and a Z vector. And if you've ever done so much as moved an object in Maya, this should all now look very familiar.If I want to move an object in an arbitrary 3 dimensional direction, I have to input three one dimensional values into the object's translation attributes. Or of course use the translation gizmo in the viewport which does that for you in real time.
This might all sound very dry - because it is - but this is a fundamental concept in... well, space! Including 3d space. Including digital 3d space inside Maya. So if you expect to make Maya dance for you, or any 3d graphics software for that matter, you need to understand how it uses vectors to describe relationships in that space. And hopefully, now you do.










No comments:
Post a Comment