Get height of node

I have one node with many objects inside. Now I want to know the absolut height.

For example a tower with 10 boxes, now I need the "meters" until I reach the top.

Hope someone understand, what I mean :smiley:

Perhaps something like this:

float height = ((BoundingBox)node.getWorldBound()).yExtent;

1 Like

Chwilówki bez bik

Are you looking for the Y-coordinate of the topmost vertex, or the difference between the Y-coordinates between the bottommost vertex and the topmost vertex?

You can often get the topmost and bottommost Y-values from the bounding box, but this is not guaranteed to work. For instance, if the Node is rotated around the X- or Z-axis, then the bounding box may have a wider range of Y-values than the object itself.

To obtain precise top and bottom coordinates, I iterate over all the vertices of all the geometries. I have code if you want it.