What's wrong with multiple addChild/removeChild on rotated object?

For now, you can try forcing a uniform scaling in box2. One way to do this is baking the transform (after scaling only), into box0:

There is a lot of info about decomposing a matrix when scaling is non-uniform. Other graphics systems have the same limitation. The primary method I’ve seen to decompose a matrix that incorporates non-uniform scaling is using a Ken Shoemake’s decomposition algorithm. Here’s the best overview for using Shoemake’s method

This type of decomposition is explained in detail in Shoemake and Duff’s Matrix Animation and Polar Decomposition paper, as well as Shoemake’s chapter on Polar Matrix Decomposition in Graphics Gems IV.

and here’s source code in C to implement it.

Note that it is fairly expensive (and iterative) operation. So even if it were available in Babylon, you’d likely want to avoid it if possible.

1 Like