• Advertisement
Sign in to follow this  

[slimDX] rotation and scaling sprites

This topic is 3561 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am trying to rotate and scale sprites in an slimDX application but I have no clue on how to do it. I tried to use the Sprite.Tranform property but I couldn't figure out how it worked because I have never worked with these transformations before. Can anyone point me in the right direction on how to rotate and scale sprites in slimDX. Thanks, ID

Share this post


Link to post
Share on other sites
Advertisement
Simply create a matrix describing the kind of transformation you want, and then use it to set the sprite's Transform property. If you don't know what matrix transformations are, you probably need to go study 3D math some more before you'll be ready to tackle a 3D API.

Share this post


Link to post
Share on other sites
well I know what matrix transformations are but I have never really worked with it.

My rotation problem is this:

I use sprite.Transform = Matrix.RotationZ(3);, but the rotationcenter is in the upperleft corner and I cant figure out how I can change this.

Share this post


Link to post
Share on other sites
Native D3D has a function called D3DXMatrixTransformation2D that allows you to specify scaling and rotation factors with a center point for both. I'm sure there's an equivalent function in SlimDX.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement