- The Blend
- Posts
- Curve gravity: messy spiderwebs part 2
Curve gravity: messy spiderwebs part 2
Build your very own Curve Gravity node
"Yikes, this is late!"
"Don’t you know it's Tuesday?"
"What happened to the EVERY MONDAY thing?"
OK. Yeah. This one is a day late. Almost two, really, since it's getting dark here.
But you're going to learn something cool today.
You'll get to control gravity.
This is Part 2 of the Messy Spiderwebs series, where you learn how to build a spiderweb generator (to make any scene look disgusting.)
In Part 1, you learned the basics of curves in Blender, and common nodes for working with curves.
Today, in Part 2, you'll learn how to make any curve look more realistic by adding gravity. You'll use nodes to adjust the curve handles so the curve hangs downward realistically.
When you're done with this one, you'll have a complete node group called Curve Gravity. You can use the node on any curve, but it'll be especially useful for the spiderweb generator.
You can read Part 1 here if you missed it.
Now let me show you how to hold the power of gravity in the palm of your hand.
How It Works, And When It Won’t
Editing Curve Handles With Nodes
Completing The Group
How It Works, And When It Won’t
When you want to shape the shape of the curve, you adjust its handles.
You already know this.
There are a few different types of handles, though. You can change them, in Edit Mode, by pressing V.
By default, the handles are the Automatic type. These are great for defining smooth, round shapes, but the handles are joined—you can’t change a vertex’s left and right handles separately.
To do that, you need the Vector handle type.
That’s how your gravity is going to work. You’ll change the curve’s handles to Vector mode, then adjust them so that it hangs downward a bit.
All with nodes.
This will work for simple curves, but not all curves. Since it makes the curve “hang down” between every vertex, it would look strange on a curve with more than 2 vertices. (try it, when you’re done.)
That’s not a problem, though. You’ll only need it on are simple, 2-vertex curves.
Editing Curve Handles With Nodes
Here’s the final setup, if you’d rather build first and talk later:
Now let’s get going.
First, add a Bézier curve object (the default one is perfect for this example.) Select it, then head to the Geometry Nodes tab. Press New to get a new setup. Name it “Curve Gravity.”
By default, Geometry Nodes treats curves (also called splines) as plain, uncurbed lines, called Poly Splines. You want to use a Bezier Spline (normal curve) so use a Set Spline Type node and switch it to Bezier.
Next you’ll need to switch the curve handles from Automatic to Vector. Add a Set Handle Type and set it to Vector.
Now you can start moving the handles. Add a Set Handle Positions node and set it to Left. This will move the left-side handles of all the vertices.
Select it and press Shift + D to duplicate it. Switch this node to Right mode.
You can adjust both the right and left handles by changing the value in the Offset socket (try it.)
Completing The Group
Since you want to move the curve handles straight down, you can use the same value for the Offset on both Set Handle Position nodes.
Add a Combine XYZ node and plug it into both Offsets. Now you can control the gravity effect by adjusting the Z value.
Cool, right?
Now you can make it a little nicer and add a tiny bit of random variation.
Add a Random Value node and plug it into the Z value on the Combine XYZ. Set the Max to 0, and plug the Min into the Group Input node so that it becomes and input control (now you can see this in the Geometry Nodes Modifier on your object.)
Select the Group Input and open the N sidebar. In the Group tab, you can rename the Min value to Strength. (because it controls the strength of the gravity.)
Problem is, when you adjust the Strength (in the modifier) bigger values make the curve “hang” upward, not downward.
Quick fix: add a Multiply node before the Random Value node, and multiply it by -1. (see image ↑)
It’s all done now. Great job!
You just learned:
How work with curve handles in nodes
How to move the curve handles by adjusting the Offsets
You also completed a finished node group that will be very important to the final project.
So SAVE THIS FILE. And enable the FAKE USER button (little shield) so you don’t lose your node group.
If you’re reading this online, now would be the perfect time to subscribe. (so you don’t miss Part 3. Or the best part, which will be Part 4.)
EDIT: Part 3 is out now—read it here.
Can't think what to blend?
Try something abstract and colorful. Anything from a plasticky tangle to a frozen wave.
P.S. I write fiction on the side, if you like that kind of thing. I made the cover of this one in Blender ↓ [all my work is 100% free to read]
Enjoy this newsletter? Please forward to a friend, it'll make my day. And theirs. (unless they hate it when you forward random newsletters to them.)
New to the newsletter? Join here (no pressure. But I really, really think you should click the button. Click the button. Click...the...button...) ↓
Reply