Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
Posted 28 April 2012 - 03:00 PM
Posted 28 April 2012 - 05:47 PM
new_x = old_x * cos(angle) - old_y * sin(angle) new_y = old_x * sin(angle) + old_y * cos(angle)
Edited by alvaro, 28 April 2012 - 05:49 PM.
Posted 29 April 2012 - 02:41 AM
Posted 29 April 2012 - 03:43 AM
Edited by haegarr, 30 April 2012 - 12:40 AM.
Posted 29 April 2012 - 04:07 AM
Posted 30 April 2012 - 12:56 AM
To be exact: You have to invert the transformation. Negation is the inversion for addition, but we have a multiplication here. Due to the fact that we deal with matrix math (where an equivalent of a division as the inverse of a normal scalar multiplication isn't defined) we speak of the matrix inverse. I mention this because negation is also a defined matrix operation but it will not result in what you want here.I had considered that the order would need reversed, in addition to negating the transformations. I actually was previously using a working local to global function. However, as you said, trying to convert all the verts in a 13000 poly model uses absurd amounts of processing power, made worse by my method of calculation. I had reversed the order, and inverted the calculations. Transformation and scale worked out fine, only rotation was behaving strangly.
That being said, I was unaware a method of calculating all transformations at once, and applying it existed. Shows where my math skills are at. In any case, that looks like it would solve my problem, so I'm going ot give it a shot.
Edited by haegarr, 30 April 2012 - 12:56 AM.
Posted 30 April 2012 - 10:20 AM
Posted 04 May 2012 - 10:39 PM
Edited by gbMike, 05 May 2012 - 01:19 AM.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.