 All right, welcome back. Okay, so in this video, what we're gonna do is we're going to work with the normals on these scattered points here. And what we need to do is we need to create a direction for the branches. So, you know, if you've ever looked at a lot of trees and stuff like that, you'll notice that the branches at the bottom kind of tend to droop down a little bit. And as they get younger and younger, they kind of still have a lot of strength to them. And so they start to fan out. And so we wanna create this kind of fanning type of look to it. So the other thing that we also need to take care of is the way that the branches kind of grow in this spiral kind of fashion around the tree. So as they grow out, they kind of spiral out from the trunk. All right, so we need to create those two types of interactions there. Okay, so let's get started. Let's go and drop down and attribute wrangle node. Attribute wrangle, there we go. Okay, and let's name these. So this one is going to be reverse normals. And this one's going to be branch normal directions. Okay. All right, so let's turn this guy on. And the thing I wanna do now is I wanna create that gradient value because if you're familiar with what we're gonna do here, let me actually explain a little bit better. What we're gonna do is we're gonna utilize the sine and cosine values. First to create that spiral action. So I just wanna create some flat normals that just basically spiral around. And then let us control the spiraling action. So let's actually take a quick second here and just take a look at that for those who aren't necessarily familiar with the sine and cosine. All right, so now let's drop down a line here. Okay, and this line is going to be, we can do it in the y direction. That actually will probably be better. All right, so let's just add a whole bunch more points to it. And let's come into the attribute wrangle node that we created. Again, this is just a test here that we're going to do. I really wanna just show what sine and cosine does. All right, so what we wanna do is we wanna create that gradient value. I need a value that goes from zero to one. All right, because what I'm looking for is a way to pull out the rotation values. And now the sine and cosine value will return for me a value of one to negative one. It basically creates this kind of sine wave. All right, it just creates a wave. All right, so to do that, remember, we can create that gradient value. Now I have a preset for it. All right, so there's the gradient preset. Okay, but let's just type in one more time. All right, so what we're gonna do is we're gonna say f at gradient is equal to that at PT num. So the current point number divided by our number of points minus one. All right, and that will give us that float value. Okay, and again, I wanna be able to cast it. All right, so let's create the cast. There we go, and there we go. All right, so now if we take a look down in our geometry spreadsheet, we have a value from zero to one. And this is perfect because we can feed that value into a sine function. All right, so let's say at P plus equals our sine. You can see it comes up right there. And we'll just pass in the at gradient like so. And you can see that we're starting to get the beginning of that curve. Okay, well let's actually just do one direction. So right now, the reason why it's facing off in the positive value is because we're adding on to this vector. So we're adding on that value to each component of the vector in the X and the Y and the Z. Let's just do the X for now. So we can see this in action. All right, so we're getting the beginning of that curve. All right, so if I were to do something like times CHFs, or a float channel, and we're gonna say offset, not offset, it's amplitude, frequency. That's what it is, we'll call it frequency like so. And then change that. You can see that now as I start to add more frequency to it, we get more and more of that wave function in there. Okay, so if I'd add more points here, we'll get a smoother curve. So we're getting that higher frequency now. All right, and then you can go and you can multiply that value by some other value. So we can call this global FREQ for global frequency. And we'll just do that and there we go. So now we can control the, what they call amplitude. So we should actually, let's just rename that to amplitude. And let's go and we'll leave that for now. So there's our amplitude and here's our frequency. Okay, so that's what that does. And it goes the same for the cosine as well. So if we were to do the same thing, let's do this like so. And then the z direction, so let's say dot z. And instead of the sine, we'll do the cosine. All right, so you can see now we're getting a spiral. Okay, so that's how you would create a spring. Now we can actually just control the length of this. Now we have a spring. Okay, so that's the basics behind the sine and cosine. So what we're gonna do is we're gonna take a look at how we apply that then to normals, all right? We went and adjusted the x and the z positions of the points on that last line in that test, all right? So what we can do is we can actually apply the same theory or concept to the normals as well. So what I'm gonna do is I'm going to drop in my gradient. All right, that way I don't have to type it again. That's why those things are really useful, all right? And what I wanna do now is I want to just adjust the normals in this case. So what I'm gonna do is I'm gonna create a float value and this is gonna be called our x-pods. And our x-pods is going to be equal to the sine of our gradient. Let's just start there, all right? And then our float z-pods is going to be equal to the cosine of our gradient like that. Very cool, okay? So with that done, what we can do is then just pass that into the normal, okay? So let's go and just set our at n dot x to equal the x-pods, all right? So instead of the at p or the position of the point we're just affecting the normal now. And now we're gonna say at n dot z is equal to our z-pods. There we go, let's take a look. And now you can see that we're starting to get a little bit of value there. But the crazy thing is that we don't have an ordered set of points. So let's take a look at our point numbers. You can see that our points aren't ordered which is why we're getting this weird effect. We want it actually to spiral from the bottom to the top. And right now it's kind of random which might actually be what you want. Let's go first before we go and fix that or at least I'll show you how to fix that. Let's create a float and we'll call this float the rotation amount. And we're gonna equal that to a float channel. We'll call that the rotation amount, all right? So then what we'll do is we'll multiply that by the rotation amount. We'll just copy that and do the same for the z. So we get the same effect on the other end and we'll create that parameter. And now if we take a look here and you can see that we're spiraling around. Now that might be perfectly valid solution to what you're looking for, okay? But if you do want more of an ordered kind of point control or control over the normals there, so you get a spiral starting from the bottom and going to the top, what we need to do is we need to do a sort. So I'm gonna drop down a sort node here, okay? And what we can do is play around with the different settings here, all right? So the point sort I'm gonna do by y. And you'll notice now we have zero, one, two, three, four, five, six, seven, eight. Perfect. And that's because it's checking the y direction. Whoever at the bottom is gonna be zero and as you get to the top, or if your y's the greatest, you're gonna be the last point in that list. Okay, so that takes care of that. And if we now take a look at our solution here, you can see that we're getting an actual spiraling rotation. So I did it really slowly. You can see now we're spiraling around. And if you overpower it, you get this kind of natural looking spiraling effect. All right, that's cool. So now what I wanna do is I wanna control the y direction. You notice they're all pointing in that same direction. They have the same y value. And again, that might be what you're after, but I actually wanna add some control to that. Okay, so let's put in a little bit of information for ourselves. I'm gonna put in a comment here and we'll just call this the x and z normal positions. Okay, and then what I'm gonna do down here is I'm going to build a y position. All right, so this y position is gonna be a float value. All right, so we'll just call this the y pods. And this is gonna be equal to a ramp. All right, and I'm gonna feed in that gradient value. Like so. All right, so let's go and I need to give it a name. That's why that's complaining. All right, so this is gonna be called our y pods. There we go. All right, and we'll just create that parameter. And what I wanna do now is put in another line. This is at n.y is equal to our y pods. Like so. And you can see now, as they start at the bottom, the branch is really flat. And as they get to the top, they're pointed up more. All right, and that's exactly what I'm looking for. So now I can overpower the top value here. Like so. All right, and we can make a negative value for the bottom to get those bottom ones to droop. Very cool. But you'll notice that our normals, as they get overpowered by this value up here, that they are actually greater than a length of one. And really, you wanna keep those values normalized. So at the very bottom here, let's say at n is equal to normalize at n, like so. And that'll keep them at their normalized lengths. Awesome, so we're doing pretty good here now. So now we've got the directions for all these. And if we were to go and place a line on these, so let's just create another line. This will come our branch line, like so. All right, and we did a copy to points. Do a copy to points. There you are. All right, we've passed that into the point, or the primitive to copy. And the points to copy to, you can see that we are getting a weird result there because we need this direction to point in the z direction. All right, anytime you use that copy to points there, you need that z direction. Or the line needs to, or the object that you're copying onto the points needs to be pointed in that forward direction, the z direction. All right, so now we have our points. But you notice that they're being scaled, so there must be an empty p scale on this or something. Somewhere. Let's turn off all these values here so we can take a look. You can see that the line is getting scaled from top to bottom. And that is not what I'm wanting. We can say that the at p scale is equal to one. Let's see if that takes care of it. And in fact, it does. So there was some p scale values left on that particular branch. Let's actually comment that out and take a look here again in the geometry spreadsheet. So that's one way you could do it. I don't necessarily recommend that. If you want to do it the clean way, what I do is do an attribute, attribute delete just to get rid of it. So what we can do is turn that on, go to our point attributes here and get rid of that p scale in the gradient because we're creating it again. So that cleans it all up. So now we don't have to put that in there. So now as I add more branches to this or more points using our resample node here, you can see that we're getting something pretty cool. All right, we can go back into our branch normal directions and change the amount of rotation again. So just pump it up even more. And we have something that is starting to look like a tree. So if we were to merge in the trunk here now, so let's get the final result of that sweep for the trunk. We're starting to get something that's kind of like a tree. All right, we're obviously gonna make it more like a tree. So I'm gonna close out the video there now that we've got most of that work done. All right, and what we're gonna do is move on and start to take care of the branch. All right, we need to do a little bit more work on the branch itself, the branch line. Okay, thanks so much.