Control By Distance

Use an Empty to take control of your nodes.

We have a bunch of new subscribers—welcome everybody!

In The Blend, we break down 1 Blender technique each week in a micro-lesson.

The Blend aims to become the world's #1 Blender newsletter. I really appreciate you reading it!

A smashing crumbling bridge

Smashing bridge—Eevee render.

You need control.

In Geometry Nodes, that's not easy.

A lot of the time, you can make something happen, but it's hard to control where it happens.

There's an amazing way to solve that problem. I discovered it a few days ago. I was building this self-destroying bridge.

Here's a detailed breakdown of the solution (with examples!)

A Control Empty.

A Control Empty is a regular Empty object used to control something else.

The way it works is by distance. The Empty controls which part of the bridge is 'not destroyed.' Parts further from the Empty are more destroyed. Closer parts are less destroyed.

Still don't get it?

Don't worry. You're going to build an example.

You'll have a simple grid of cubes. You'll be able to control which cubes are randomly rotated by moving an Empty through the cubes.

This time, I'll show you the nodes first, then explain them. Here's the final setup:

Node tree in Blender

Distance control example—try building it!

Here's how it works (or you can just enjoy it and ignore this part.)

  1. We start with a 5x5 Grid. 15 verts to a side. Then we plug this into an Instance On Points node, and instance a Cube(scaled down a little) on each of its points. The result? A grid layout of cubes.

  2. This Object Info node is the Control Empty. I simply dragged it from the Outliner right into the node editor. Switch it to Relative mode.

  3. The Position node give the position of each instance.

  4. Here's where the magic happens: the Distance node. This is a Vector Math node, switched to Distance mode. It tells you the distance between 2 positions—in this case, the position of the Empty and the position of each cube.

  5. This gives us random values so the Rotate Instances node can randomly rotate the cube.

  6. The Rotate Instances node rotates all of the cubes a random amount. But if we use the distance to the Empty to control how strong that rotation is, we have achieved control! The Scale node is a Vector Math node set to Scale. Smaller factor = weaker rotation. The Map Range node lets us change the output of the Distance node to go from 1 to 0 instead of 0 to 1.

  7. This node does the actual rotating. Since the rotation is being scaled based on the distance to the Empty, cubes further away will rotate less, and cubes closer will rotate more.

Great job getting through that.

I encourage you to build the setup—it'll probably make way more sense when you look at it in Blender.

Does the Map Range still confuse you?

Here's more on that.

Select the Map Range and Scale nodes and press M to mute them.

Now you have a bunch of cubes. They're all rotated a random amount.

If you add the Scale node back in (select it and press M again to unmute), you're allowing the Distance to control how strong the rotation is. When the empty is close to a cube (so distance = 0), the rotation is scaled to 0 by the Scale node. When the Empty is further from a cube (so distance > 0) the rotation is stronger.

This works. But we want the opposite effect: cubes that are rotated when the distance is 0, and less rotated when the distance is greater than 0.

Solution?

That's exactly what the Map Range node does (set To Min to 1 and To Max to 0.) It makes a new value, based off the distance value. When the distance is 0, the Map Range gives us 1. When the distance is 1, the Map Range gives us 0.

Unmute the Map Range to see it in action.

Cool, right?

Map Range can solve a lot of problems—it's a good node to keep in your toolbelt.

That's it for today.

If you have 15 extra minutes and you want to practice what you just learned, check out my brand-new video. I show you how to make an awesome destruction effect.

Have a great week.

(watch a video of that awesome render ↑ here)

P.S. (unrelated) Love reading fiction? Check out Voyage. You get a new, original piece of short fiction every other Friday. (And it's totally free.)

Weekly Render Prompt

Forgot this last time...

> Make something delicate out of gold

    The Fine Print

    Know anybody who likes Blender? They'll probably think you're awesome if you forward them this email.

    If someone forwarded this to you, then sign up here—unless you trust them to forward it again next week!

    P. S. Have a topic you want covered? I'm always open to new ideas—reply to this email with your suggestions!

    Reply

    or to participate.