Categories
Blender

Make buildings with custom Rotation with Geometry nodes in Blender

In this tutorial, we are going to use geometry nodes to place multiple buildings and rotate them 90,180,270 and 360 degrees. We will add buildings in one collection and then use a plane to instance them using point scattering . We shall use Point Distribution and Point Instance for this. Different buildings will have different rotations. We will use pre made 3d models of the buildings.

Joining existing Geometry with the procedural Geometry

Add Join Geometry node by clicking Add > Geometry > Join Geometry.

The Join Geometry node joins two geometries, in our case, the building made by point scattering and the original plane.

The Join Geometry node should be added before Group Output.

Make sure that the origin of all the buildings is same for this method to work.

Now, we see that all of the buildings have same rotation, they all are facing the same direction. We want the buildings to be rotated in an organized way. Now, we are going to rotate the buildings 90, 180, 270 and 360 degrees.

Adding Point Rotate to rotate the objects

We can rotate every point using the Point Rotate node. Click Add > Point > Point Rotate to add the node.

Make sure that the point rotate node is after the Point Distribute node.

Point Rotate can rotate every point either by using an attribute or a vector.

Data can be stored in an attribute such as a vertex group. To make this, we are going to use attribute to rotate the buildings.

Select Euler and Point on the Point Rotate node, because we want to rotate the points. Select the Rotation to be Attribute.

We have named the attribute for the rotation to be “rot”, this is the attribute where the data for our rotation will be stored. So, write “rot” in the Rotation attribute of the Point Rotate node and also in the Result of Attribute Vector Math.

We are going to rotate 90 degrees and then multiply that number with either 1,2,3 or 4 to get the desired rotation, and that is why we need Attribute Vector Math node before the Point Rotate node.

Adding Attribute Vector Math for Multiplication

Add Attribute Vector Math by clicking Add > Attribute > Attribute Vector Math.

Multiplying Attribute with a Vector

In the Attribute Vector Math, change the operation to Multiply. Make sure Type A is an Attribute and Type B is a Vector.

We are going to multiply the attribute with a vector, vector will be 90 degrees, and the attribute will contain one of the digits from 1,2,3 or 4. This way we can rotate the buildings.

We need to get a random number between 1 and 4, and that number will be stored in an attribute, and that attribute will be the Type A attribute of Attribute Vector Math.

Exit mobile version