[slimDX] rotation and scaling sprites

Started by
3 comments, last by Promit 15 years, 10 months ago
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
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.
Mike Popoloski | Journal | SlimDX
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.
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.
There sure is: Matrix.Transformation2D.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.

This topic is closed to new replies.

Advertisement