Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DirectX Sprite Rotation

Status
Not open for further replies.

darxpan

Programmer
Oct 14, 2003
33
US
I am working on a 2D game using direct3D. I am using the spriite class to render my objects to screen. I can't figure out how to rotate the Image.

I tried Sprite.transform.RotateZ(angle) , but I saw no difference on the screen. I even tried Device.Transform.RotateZ(angle); , and I couldn't tell that it did anything either.

What am I doing wrong? Any suggestions would be welcome.
 
I figured this out. It is strange. The Matrix.Rotate... functions say they return void, but they seem to actually return a matrix. For example, this:

sprite.Transform = Matrix.Transform2D(a,b,c,d,e,f);

works. There are other cases where an assignement won't work, but I used that one in my code and it runs.

The directX documentation is so poor.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top