Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#Actualtom_mai78101

Posted 25 September 2012 - 10:15 AM

Update [Solved]:

I found the algorithm to matrix manipulation here. Quoted from there below:

Usually it is scale * rotation * translation. However, if you want to rotate an object around a certain point, then it is scale * point_translation * rotation * object_translation.

Why: First you want to scale the object so that the translations work properly. Then you rotate the axes so the translation takes place on the adjusted axes. Finally you translate the object to it's position.


Sorry to waste your time. In the end, I learned something. Posted Image

EDIT:

The "point_translation" is a bit confusing for me, but I managed it. The origin of an identity matrix is at (0, 0), with X (right = positive), Y (down = positive), which is also the top left corner of a bitmap. (Don't know how to type that...)

To create the point_translation, we need to move the origin in the opposite direction we intended to move on the bitmap object. That means if we focus on the bitmap only, the origin should be set to move to a spot on the bitmap, then multiply the offset values by -1.

It will move the origin backwards. That's all the explanation I can say. It's a tricky and confusing one to why it works, but that's math for me. Posted Image

#2tom_mai78101

Posted 25 September 2012 - 08:56 AM

Update [Solved]:

I found the algorithm to matrix manipulation here. Quoted from there below:

Usually it is scale * rotation * translation. However, if you want to rotate an object around a certain point, then it is scale * point_translation * rotation * object_translation.

Why: First you want to scale the object so that the translations work properly. Then you rotate the axes so the translation takes place on the adjusted axes. Finally you translate the object to it's position.


Sorry to waste your time. In the end, I learned something. Posted Image

EDIT:

The "point_translation" is a bit confusing for me, but I managed it. The origin of an identity matrix is at (0, 0), with X (right = positive), Y (down = positive). (Don't know how to type that...)

To create the point_translation, we need to move the origin in the opposite direction we intended to move on the bitmap object. That means if we focus on the bitmap only, the origin should be set to move to a spot on the bitmap, then multiply the offset values by -1.

It will move the origin backwards. That's all the explanation I can say. It's a tricky and confusing one to why it works, but that's math for me. :)

#1tom_mai78101

Posted 25 September 2012 - 08:05 AM

Update [Solved]:

I found the algorithm to matrix manipulation here. Quoted from there below:

Usually it is scale * rotation * translation. However, if you want to rotate an object around a certain point, then it is scale * point_translation * rotation * object_translation.

Why: First you want to scale the object so that the translations work properly. Then you rotate the axes so the translation takes place on the adjusted axes. Finally you translate the object to it's position.


Sorry to waste your time. In the end, I learned something. :D

PARTNERS