- [Instructor] Welcome.
I have my exercise file open already.
This is the first of two videos
focused on the essentials of vector math,
and we're going to start with the basics.
I have a vector here that I'm visualizing,
I'm controlling with these two sliders.
So let's look at addition.
If I copy this,
and I add these two vectors together,
basically what I get is really intuitive.
If I physically stacked these vectors on top of each other,
let's visualize this other second vector
starting from the end of the first vector,
and let's see what's happening here.
Let's make some adjustments here.
So I have vector one and vector two stacked up.
And then, now I'm adding the two vectors together.
So if I take that added vector
it always matches up the two individual vectors.
So no matter what I do, when I add the two vectors together,
I get a sum of the effect of both vectors.
Pretty straightforward.
Now if I multiply, it's going to be equally intuitive.
So I have a slider here just from zero to one,
and I'll multiply that our initial vector
times that first slider,
and as I slide the slider back and forth
it scales the vector.
So multiplication is just kind of a scaling effect
on these vectors.
Now let's look at something a little more interesting.
If I go to Vector,
I'm going to grab the cross product component,
and I'm going to go back to Vector and get the unit Z.
So now if I plug in my,
let's get rid of the multiplication,
if I plug in the first vector in the unit Z vector,
and I visualize the result,
this cross product gives me a vector that's perpendicular
to the plane that would fit through the two input vectors.
This is actually really useful.
If you're trying to create planes
and control the location of those planes
or their rotation in space in relationship
with the world coordinate system
this cross product component becomes really powerful.
So let's look at how that works.
I'm going to turn this curve on.
So it's a curve that's kind of going through space here.
And I'm going to go to Curve, Division, Perpendicular Frames.
I'm just going to create a series of frames on this curve.
We'll set the number of frames to five.
So these perpendicular frames,
the normal is really easy to expect.
The normal is going to be tangent to the curve
at each location of the frames.
But the rotation of the frames is much harder to predict,
and if you're calling it a bunch of curves,
and you're trying to generate geometry from those curves,
this can be a kind of a bear, a kind of a headache,
because if you're sort of lofting stuff along this,
and let's say you're lofting sections
to create steel parts or something like that,
you don't have a ton of control
over the orientation of those sections.
So let's see what that looks like.
If I go back to Curve, and Primitive, Rectangle,
I'm going to create a series of rectangles
on each of those planes.
I will turn the preview off,
and then I'm going to loft them.
So you can see how this is kind of twisting.
The part isn't consistent,
or the sections aren't consistently oriented
in relationship to any of the world coordinate vectors.
So let's see how we can fix that or adjust that
or control that using cross product.
So I'm going to copy my cross product component.
I'm going to decompose these planes.
So go to Vector, Deconstruct Plane.
Now I have the vectors within the planes.
And I'm going to use the Z vector,
'cause that's the vector that's tangent to the curve.
That's the one that's really predictable.
I'm going to plug that in,
and I'm going to orient all these planes
so that their sections are sort of vertical
but twisting with the curve as it moves through space.
And that'll make more sense as I let's say build it up.
Okay, so let's visualize this.
Let me copy this vector visualization.
I'll plug in the origin as the anchor,
and I see how now my cross product
is giving me these vectors
which are sort of sticking out to the side
consistently from that curve.
And I'm going to use the cross product again,
and now I'm going to plug in the Z vector
which is tangent to the curve, here,
and this vector that I've created,
which is sticking out to the side of the curve here,
and let's visualize that.
So that's kind of sticking,
and it's rotating with the curve, but it's always,
you can think of it as straight up and down,
but then being rotated along the curve.
So if I rebuild the plane
based on these curves that I've created, plug in the origin,
the side is going to be the X
and the vertical is going to be the Y,
and now if I plug that in
you can see how the section stays up and down
as it moves through space,
even though it's twisting with this three-dimensional curve.
So the key thing here is that this cross product component
allows you to manipulate and control the rotation
of planes in space in a really powerful way,
by referencing the world coordinate system
as you're generating those planes.