Skip to main content
GameDev.net gamedev.net
🔒 Locked

2D Transformation Query

Started by Andrew Russell Dec 3, 2004 at 11:01 PM 1 replies 750+ views
Original Post
Andrew Russell
Andrew Russell
Hey chaps, very quick 2D transformation matrix question: Say I have some 3x3 transformation matrix, and I want to basically "zero" the translation only (I want it to keep all the rotation and scaling and such info in tact). How would I go about doing this?
Andrew Russell
Andrew Russell
I think I've answered my own question here:

I'm basically wanting the vector (0,0) to translate to (0,0).

So if I translate (0,0) by the orginal matrix, I'll get some vector (x,y). Now if I do a translation operation on my matrix with the vector (-x,-y), It'll translate itself back to the origin (and (0,0) will transform to (0,0)).

Yes?
Painless
Painless
[ a b c ] * [ x ][ d e f ]   [ y ][ 0 0 1 ]   [ 1 ]= [ x * a + y * b + c   d * x + e * y + f   1 ]

Just set c and f to 0.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.