Jump to content
  • Advertisement
Sign in to follow this  

Scaling / Shear

This topic is 1659 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all,

Here how extract from a scaling+shear matrix in vector3 :

// Scaling part.
Scaling.x = Matrix[0][0];
Scaling.y = Matrix[1][1];
Scaling.z = Matrix[2][2];

// Shear part.
float InvD0 = 1.0f / Scaling.x;
Shear.x = Matrix[0][1] * InvD0 ;
Shear.y = Matrix[0][2] * InvD0 ;
Shear.z = Matrix[1][2] / Scaling.y;

The goal is to only have scaling vector3, is it correct to mul both like that :

FinalScaling = Scaling * Shear

Thanks for the help

Edited by Alundra

Share this post

Link to post
Share on other sites

Once you allow non-uniform scaling you can NOT decompose in SRT. You can either use polar decomposition or QR decomposition. With QR decomposition you can then decompose the Q matrix further into  a scaling and shearing part. With polar decomposition this is not possible to my knowledge. You need to keep scale and shear separately and cannot combine them into one final scale.


In the engine I would recommend to allow only uniform scale, because there is always a clear decomposition. On the tool side you might allow non-uniform scale. You can always propagate the scale and shear downwards the hierarchy and bake it into a shape (mesh) if you hit one or let it go away.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!