In this tutorial, we are going to address an issue with the current method to make multiple instances. As we increase the number of vertices, the distance between the instance objects decreases. We are going to see why this problem occurs and what is the solution. Blender version 2.93 is used.
Change in Distance between Instance Objects after Changing Vertices
As it can be compared from the following images, the distance decreases, as the number of instance objects increase.
If we take a look at the geometry nodes, when we increase the number of vertices or instance objects, the size of the grid also increases but not by the amount it should. In an ideal case, the distance between two instance object should always remain same.
The problem is due to a simple reason, when we increase the number of instance objects, basically, we do it by increasing the number of vertices, so the distance between two vertices along the same axis should remain the same. But as a new vertex is added, the size of grid is increased, thus making room for a new set of vertices, but the distance between two vertices is decreased.
Relating Vertices with faces
When there are 2 set of vertices, there is 1 face. 3 set of vertices divide the mesh into 2 faces and so on. In the current situation, the distance between size of the grid on a particular axis should be divided by the number of faces, and the resultant is Length between two vertices.
|Set of Vertices||Regions or Faces|
Length between two vertices
The correct formula becomes:
Length between two vertices = Size of the grid * Number of faces
To get the distance between two vertices, we have been multiplying the size of grid with the number of vertices, instead, we should multiply it with the number of faces.
The number of faces is one less than the number of vertices
The solution is very simple, we just need to subtract 1 from the number of vertices node that determines size of grid.
Adding a Math Subtract Node
To do that add a Math node before the Math Multiply node by clicking
Add > Utilities > Math. Change the Operation to
Subtract and change the second value to 1. Make sure this is done in this exact order. Do this for both X and Y axis.
This is the final setup node.
As we can see from the video below, the distance between Instance Objects remains constant.
The previous parts of the tutorial series :