I'm doing text animation in geometric nodes. I'm trying to animate the letters around their center, but all the transforms are only applied relative to the bottom left corner. Is it possible to do transformations from the center of the letter? Blender 3.0
- move letters apart,
- use Bounding Box node to get a cube for each letter,
- remove all but top face from each cube,
- for each instance find the nearest face coming from the Bounding Box (that's why letters have to be moved apart, so the right face is matched),
- take the position of that face, which is the center of the bounding box,
- rotate around that center,
- move letters back together.
If you're prepared to use a recent Blender 3.1a, a couple of new nodes make this method possible. You can type in your text as a single object.. it will be interpreted as a Mesh by GN.
Then, this set of nodes will spin each mesh island in Y, around its mean X, by the input Angle:
There might be some edge-cases requiring more nodes, for example where characters are more than one island, off-center .. but something based on this may do the trick.
Blender 3.1a, at answer's date.
Because you didn't post the node tree I can only give you a generic answer. It should be enough to point you in the right direction.
The reason their Origins are bottom left
By default instances use the origin of the instanced geometry. Blender can't guess where you wish the origins for the letters were, it can only work with the coordinates you're actually passing to it.
If your text has a bottom left origin because the original text mesh was created using a Left, Top Baseline alignment that's how the instances will be spawned.
Solution 1: Text-specific method
Create the text using a Center, Middle alignment. This method will center the letter relative to the text's line-height. It'll make the origin of the various bits of text consistent, but it won't return the real, geometry origin.
Depending on what you're doing you'll want to use this method.
Solution 2: Generic geometry method
To set the text on its real geometric origin you'll need to figure out its width and height, then halve it by 2 an multiply it by -1 to offset it in the correct direction.
The old way to do this was to perform calculations on the Min/Max of a Bounding Box. Thanks to the new Attribute Statistic node, you can simply grab its Mean point.