Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm currently trying to transform a system by scaling it on x and y axis and have some uncertainty. I have the general concept that scaling works as such:

My original box has corners at (0, 0) and (3, 2) and I'm asked to scale the x axis by 3 and the y axis by -2.

Is this what the correct solution would look like (with corners at (0,2) and (6,-2))?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Given the points you have, no. The new rectangle will be defined by the points (0, 0) and (6, -4). The point on the origin will not scale to a new position where are the other point you have will. Scaling by -2 in the y will flip the rectangle so instead of having a point in the bottom left and top right it will now be in the top left and bottom right.

share|improve this answer
    
Got it. Is this what it would look like? –  Kermit Mar 30 '13 at 18:06
    
Yes it is. Best is to remember that scaling will move things away (or if less than 0 then towards) the origin. Since a point is already at the origin it will stay there. –  Kreutzwj Mar 30 '13 at 18:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.