y-direction shearing matrix and its equivalence
I want to know how rotation and scaling equivalent y开发者_运维问答-direction shearing matrix?
1 0 0
shx 1 -shy.xref
0 0 1
I understood what shearing mean but how can get it using rotation and scaling ??
thank you :)
Shearing cannot be constructed using just rotation and scaling.
Shearing is an affine transformation and rotation and scaling are "rigid" transformation which are less expressive.
more on this:
http://en.wikipedia.org/wiki/Affine_transformation
Yup it can be done, a rotation followed by non uniform scaling and reverse rotation. You can find the details here in third question http://www.cs.cmu.edu/~djames/15-462/Fall03/assts/15-462-Fall03-wrAssign1-answer.pdf. you can try the following openGL code as well. It rotates a rectangle by 45 degree then scales in x-axis. and then rotates in -26 degree i.e. atan(0.5). 0.5 comes from finding the angle between x-axis and one side after scaling in x-direction.
glRotatef(-26.0, 0.0, 0.0, 1.0);
glScalef(2,1,1);
glRotatef(45.0, 0.0, 0.0, 1.0);
glRectf(0, 0, 25.0, 25.0);
精彩评论