We can get the location of an object, its origin point, in Blender Geometry Nodes using just two nodes: Object Info and Self Object.
Add Suzanne mesh to the scene (shift + a – Mesh – Monkey) and move it slightly to the side from the origin point.
Add the Geometry Nodes modifier and create a new node tree by clicking the “New” button.
To work not with the position of each point of the object, but with the origin point of the object itself, the Object Info node is used.
Add this node to the node tree (shift + a – Input – Scene – Object Info).
We will get the position of the object’s origin from the “Location” output of this node.
The Object Info node is universal and can provide information on any object in the scene. But we need to get data on the current object. The Self Object node will help us with this.
Add the Self Object node to the node tree (shift + a – Input – Scene – Self Object). Connect its “Self Object” output to the “Object” input of the Object Info node.
Now the Object Info node gives us information, in our case – the location from the “Location” output, on the object itself.
For clarity, let’s display it as text next to the object in the scene.
The String to Curves node is used to output text to the scene. Add it to the node tree (shift + a – Utilities – Text – String to Curves). Connect the “Curve Instances” output will the geometry output node.
And now we need to convert the vector with the object coordinates, that we get from the “Location” output, into a string to feed it to the “String” input of the String to Curves node.
The Value to String node is used to convert numeric values to text. Add it to the node tree (shift + a – Utilities – Text – Value to String). Feed it the object coordinates, and the output string to the “String” input. Set the value in the “Decimals” field to 2. This means that we will round the numeric value to the second decimal place.
The Value to String node is designed to convert to string simple floating-point or integer numbers. Therefore, only the first X coordinate of the object’s location is displayed in the scene – the node takes only the first number out of three for conversion.
To display coordinates on all three axes, first split the coordinate into components using the Separate XYZ node, and then we will combine the resulting individual strings for each individual coordinate into one string.
Add the Separate XYZ node (shift + a – Utilities – Vector – Separate XYZ) after the Object Info node.
Make 2 additional copies of the Value to String node (shift + d) and connect them to each individual coordinate obtained.
To join strings into one, use the Join Strings node. Add it (shift + a – Utilities – Text – Join Strings) before the String to Curves node. In the “Delimiter” field, type a comma and a space.
Now we see all three coordinates in the scene.
Add a Rotate Instances node (shift + a – Instances – Rotate Instances) after the String to Curves node to rotate the text vertically. Type 90 degrees in the “Rotation – X” field.
Now the text is positioned vertically. Join it with the object itself.
Add a Join Geometry node to the end of the node tree and connect the Geometry outputs of the object and the text we received to it.
To control the position of the text relative to the object itself, so that they do not overlap, add a Set Position node (shift + a – Geometry – Write – Set Position) after the Rotate Instances node. By filling the X, Y and Z fields, shift the text so that it is displayed next to the object.
That’s all, now when moving an object, we will always see the coordinates of its position in the scene.