   Sprites, Rotation, and Origin
  Okay, I've been batting my head against this problem for atleast an hour and it's getting annoying.I have a demo that calls for a sprite to rotate based on mouse movement(think a cannon that aims up or down as you move the mouse) which was fairly easy to implement. My problem is when the user holds the mouse button, the cannon is supposed to shoot out a continuous laser beam(just a scaled textured) that will rotate with the cannon. It seems like a simple Translate, Rotate, draw problem, but the way D3D seems to handle 2D, I can't tell it to apply the rotation after the translation(as the rotation should use the cannons position as it's origin). I tried calling ID3DXSprite's SetTransform function twice(first with the translation matrix, 2nd with the rotation matrix) but to no avail.Anyone have any suggestions?   
  Try using the world transform to make your sprite transformations, that way you can just mutiply the matricies in the order you want them.You multiply them in the order reverse to how you want them applied.Also, make sure your pivot point is relative to the sprite you're rotating, and don't set it is an absolute point on screen.I had a very similar question using managed code, you can see it here.   ;Quote:Original post by MaxamorTry using the world transform to make your sprite transformations, that way you can just mutiply the matricies in the order you want them.You multiply them in the order reverse to how you want them applied.Also, make sure your pivot point is relative to the sprite you're rotating, and don't set it is an absolute point on screen.I had a very similar question using managed code, you can see it here.Ah, Thanks.I ended up just playing with numbers till I got it right, so it works for now. But thats to you I'll probably go back and use my matrices.   