#How to calculate the Y difference between text geometry's baseline and lowest vertex?

3 messages · Page 1 of 1 (latest)

pure hare
#

Let's say I am rendering my text geometry at position (0, Y1, 0). I want my text geometry's lowest vertex's Y coordinate to equal Y1.
To do this, I'd have to add Y2 to my text geometry's position, but how do I calculate which number Y2 should be?

#

For example lower vertices for the ( and ) glyphs go below Y1.

stuck rock
#

If you just want the text to be bottom aligned you can get it’s bounding box, then move it up by half it’s AABB height

That will effectively “zero-out” the Y coordinate, you can then add your Y1 to it and have it be bottom aligned at any Y