I'm a programmer trying to remember math stuff. I think this is right.
I have a rectangle in 2D space. I want to scale it around a certain point inside of the rectangle, but not necessarily the center. Let's call it x,y. I think I have to create a transformation matrix to do this properly. So here's what I came up with:
- Translate by -x (to move x to the origin)
- Scale by the scale factor
- Translate by x, to "move back"
So now I've put that into a Transformation matrix (I'm doing this in a programming language, so I think that the order is correct). But, when I multiply the transformation matrix by the origin of the rectangle, I get what I think is the wrong result.
Am I totally barking up the wrong tree here?