Search code examples
openglmatrixgraphicsrotational-matrices

matrix non uniform scale rotation issue


I just ran into this while doing some 2d graphics work with opengl.

if I do a non uniform scale then rotation things gets really wonky. This is because the upper 3x3 matrix holds both rotation and scale.

what are some ways to deal with this non uniform scaling and rotations? I could provide a video but I am sure most people here have seen this problem although I could provide a video.


Solution

  • It depends upon what type of output you want, you have to see when you are rotating the object , around what axis you want to rotate the object. If you want to rotate the object around its own axis, better translate back to origin and then do your transformations and then again translate back to original position. if you can post video, it will be better to visualize what you exactly want. Also order of transformation can make things reaaly wonky :)