vbNeo
Apr 24th, 2007, 09:56 AM
Hi,
I'm trying to get per pixel collision detection working in XNA, but I'm afraid that I'm stuck at the idea fase.
I pretty much have an idea on how to do collision detection on sprites that aren't transformed in any way(rotated, scaled), by first checking their bounding rectangle, and thereafter checking each pixels value.
My problem is trying to figure out how to check collision detection on objects that are being rotated, because the rotation happens during the rendering, which means for all I know the graphics processor could be the one calculating the rotation.
Is there any function in XNA that returns a rotated image? And if not, does anyone have an idea on how to approach this? Do I have to write something that rotates the sprite myself?
I've tried googling, and so far I've found some examples in which the rotation is handled by the actual application - I'm having a hard time figuring out how it works exactly though, and I'm holding on to the idea that something like it must be part of XNA.
Any help is greatly appreciated.
I'm trying to get per pixel collision detection working in XNA, but I'm afraid that I'm stuck at the idea fase.
I pretty much have an idea on how to do collision detection on sprites that aren't transformed in any way(rotated, scaled), by first checking their bounding rectangle, and thereafter checking each pixels value.
My problem is trying to figure out how to check collision detection on objects that are being rotated, because the rotation happens during the rendering, which means for all I know the graphics processor could be the one calculating the rotation.
Is there any function in XNA that returns a rotated image? And if not, does anyone have an idea on how to approach this? Do I have to write something that rotates the sprite myself?
I've tried googling, and so far I've found some examples in which the rotation is handled by the actual application - I'm having a hard time figuring out how it works exactly though, and I'm holding on to the idea that something like it must be part of XNA.
Any help is greatly appreciated.