So in this session I think that I will give you a short introduction to the vector mask as well.
So start right away.
And what I get to do is hexagon.
I stopped by an input so shift a.
And then I go to input texture comment and I will use object.
And if you're thinking about the hexagon you can see that it's mirrored the same side or left the right
is just the opposite side.
So we can use object and I can also use absolute to get married.
So Shift A and go to convert.
But when I select the absolute I will not get the math.
I would go to vector math so if I could do math I also have to absolute in the vector math.
And that means that if I use it like this I can very easily transform any negative number in any direction
to be a non negative number.
So I put that into the object and now I'm guaranteed to never have a negative number that comes out
from that one.
So that's an easy way to do it.
And that's your first vector math.
I believe if we take away the length that we had in the last session but after that I will do a separation
in a way so I press shift a code to convert and separate x y set.
So we have something to work with him and then I will start to use not a thing.
I will use something called a dot product.
So I press shift.
I get that.
And here I would have vector math and I would take the vector from here and I will add dot to the top
product.
So we have it.
And I will also change this to product.
And as you can see the output is blue it's gray.
So it's a value and a value we get is the angle of difference between this vector that comes in and
this vector here and I can show you a bit about that.
So if I take a corner up here and shift a convert.
Colorado.
So we have something to get color from.
Put the vector to.
And take that and say Yes I have rendered view then you can say it's right now very black but if I Shange
this to like your point to separate two and I dragged it out like this then you can say we get this
shape here.
That is because I used the absolute here.
If if I take your way to absolute to get killed directly here right.
Then you can say it's a diagonal line here.
If I use that number and exactly where that line should be I can increase the value and I can increase
the value.
So if those value are the same it will be making out a vector which sees its value.
Here goes all the way with increasing value all the time.
Then you will get like these 45 degrees.
Then you can change that direction with the dot product.
By changing these values here so you can make it go on any direction as you want to.
So the product is really useful to draw things with since you can change the direction of the output
here and you can also put in a non static value here to get shapes that are not straight lies.
But now we are working with the hexagon so we should do a straight line.
However we should not do 45 degrees because we will have a straight line first but then it should go
down a bit and then we have a straight line.
And since we have a part here that is a little bit less than 45 degrees we need to do some math here.
I will go back to.
So we're using the absolute here.
So take the object and put that in there and I then take the absolute here and in to this one so we
get some value here.
And now you can see we are back to are square formation here where we can play with things to get correct
and get for a hexagon.
We should put in an X over 1 and Y all the square root of 3 and I can write the square root number right
here.
If I know it and then calculated or I can use Square it.
So I think I would use a square root to do it.
I put in a combined festivals up a shift a then I go to convert.
And here I have combined x y since I put that in here.
And as I said the X should be 1 and a Y should be the square root of 3.
So then I used yes to use the math of square root shift a convert and go to math.
So how did the math here.
And put that into the y axis and then I just changed to add into square root and I can now put in a
value so I can't write three here to get the face or you can try that out.
You can see it's bigger like this.
So now we have more space for that one.
So now you can say the angle is not 45 degrees.
It's a little bit less right now.
So we now fixed that one and then we should do something more.
We should say so the vector is never longer than one.
So to do that you use something called normalize.
It's often used in vector math.
So I would put in that in here before we get that value out here it will not do any difference here
but it will do in the end result and I will show you the difference for and off goes on.
But right now I just perceive pay cash to convert and then I put in vector math I put it in here and
here I change it into normalize normalize.
Only have one value in.
You can see it got bigger now than it was before.
And what it does is as I said you have some y direction you have some extraction or so on.
And in those cases that it's bigger than run it recalculate everything.
So get a value of maximum one but you keep the direction.
So if it's pointing if a hanging angle of like 30 degrees or whatever if you compare to x and y axis
it still will be 30 degrees afterwards but you can be assured that nothing is bigger than one in length.
So that is how I use normalize and that is so we can get these shapes to always be perfect for our hexagon.
So now we have that and the only thing we need now is that we need to put in like straight lines here
and that we can do by combining and comparing what we get from out here we get here.
So if they were cast if it takes us the maximum value it will fade out automatically when it's time
to get some say.
So what they will do is obtain a maximum between him.
So he has squeezed chipped again and they're not pretty and convert to a math and one add here and I
would use X here combined hours and now Cassie to shrink the bed here change this into maximum right
now.
Have this hexagon.
So not so many notes but still kept it.
And you can get put constant here if you want to have it like that.
So and then you can change the size and so on so you get it like that.
So now you've tried using some of the dot products and also using normal lives and using absolutes.
We are now working with the vector math and you can do as I said a lot more with dot products.
If I put in a value that is not static you can see that it's not a straight line because now we have
two vectors.
The difference between them will be shown in the dot product which means that you can use that product
to a lot of stuff when you are building new textures.
But right now we just use static values and we use the angle for calculating this hexagon and absolute
yes doctor knows since before and normalize it so that we only have a length of 1 when everything comes
out.
So I hope you have learned anything right now and seen how you can were quick with vector math and I
will continue with some vector math even in mixed sessions.
See you then.
Bye for now.