How to determine the corner points of a rotated mesh?

I rotated a mesh on the x axis.

Now I want to determine the corner points in order to be able to map them using a custom mesh.

In the playground you see two cubes.
The grey one is the original one.
The colored cube is my incomplete solution so far.

https://www.babylonjs-playground.com/#F30WA9#1

I need some help, please.

Hi @Necips

I’m not sure to fully understand what you want to do.
Do you want to transform positions from the colored cube so that it will be like the grey box?
To do so, you have to transform each position from the vertexdata
Check out how I did it for the navigation mesh, it migh be a good starting point.


Let me know if I misunderstood your needs :slight_smile:

I guess there’s a couple of ways. If it’s cubes, you can use the vectorsWorld of the boundingBox, or bake the current transform into the vertices, updating the positions:
https://www.babylonjs-playground.com/#F30WA9#2

thank you guys! :slight_smile: