Death by Vectors

Grow your node skills by learning the basics of vector math.

We have a bunch of new subscribers—thanks for coming 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. Enjoy the ride!

Skip to the end for an easy Doctor Strange Portal tutorial!

6 Vector Math Nodes in a deadly lineup

The Vector Math node set to 6 different modes

I don't know a ton of math.

When it comes to big messy node networks (the kind you get in demo files) I'm always struggling to follow the math. Separate XYZ? Divide by 500 to the power of 5 times 19.383?

Still, though, math has its place. Especially in the world of nodes.

In Geometry Nodes, we work with vectors. Most of the math is done in Vector Math nodes.

But what's a vector?

A vector is a set of numbers. In Geometry Nodes, we use 3-dimensional vectors, which have 3 components: an X, a Y, and a Z.

Examples:

(9, 3, 5) and (0, 1, 1) are both examples of 3D vectors.

You can imagine a vector as an arrow, starting at the world origin, and ending at the XYZ coordinates specified by the vector's components. The length of the arrow represents the vector's length or magnitude.

Here's what (0, 1, 1) looks like as an arrow:

Vector (0, 1, 1) shown as an arrow in 3D space

Vector (0, 1, 1) shown as an arrow in 3D space

To do math with these vectors, Blender has given us the Vector Math node. It's incredibly powerful.

The Vector Math node usually takes vector values (purple sockets) as inputs, but you can also treat color values (yellow sockets) as vectors.

Why?

Colors are also sets of 3 values: Red, Green, and Blue. If you use a color as a vector (like the noise texture in the portal video ↓) Blender is happy to treat the RGB values as XYZ ones.

The Vector Math node has tons of different modes. I don't know what most of them do, but here's 6 useful ones I do know.

By default, the Vector Math node is in Add mode.

1. Add Mode:

Very simple. Adds both vectors together to make a new vector: both Xs are added to make a new X, both Ys are added to make a new Y, and both Zs are added together to make a new Z.

2. Multiply Mode:

Exactly like Add mode but with multiplying instead.

3. Scale Mode:

Takes 1 vector and 1 number (the scale) as inputs. It multiplies each component of the vector by the scale value. X times scale = new X, y times scale = new Y, Z times scale = new Z.

This is awesome for changing the strength of something (like a noise texture.)

4. Length Mode:

Gives you the exact length (or magnitude) of a vector.

5. Dot Product Mode:

The dot product tells you whether 2 vectors point in the same direction or not. Outputs 1 when the two vectors are pointing the same way, and -1 when they're pointing in exactly opposite directions.

6. Cross Product Mode:

Gives you a vector pointing exactly perpendicular to the two input vectors. For example, if you input a vector that points exactly along the X axis and one that points exactly along the Y axis, the Cross Product will output a vector that points directly along the Z axis.

In the portal tutorial below, I use the Cross Product to create the velocity for the particles. Have a look!

Tutorial

In this tutorial, I take you step-by-step through building this portal, one node at a time. You also learn how to make a neat material for it.

P.S. I didn't invent this portal—I learned how to make it in this great video by Cartesian Caramel. He breaks it down in extreme detail—you learn a ton in this video! It's a bit long (3h), but worth if it you want to learn a lot.

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!

Join the conversation

or to participate.