   D3DXMatrixTransformation2D ??
  I am trying to add scaling and rotation to my sprite class.  I read somewhere you should use D3DXMatrixTransformation2D for the 2D rotation, etc.The following works well but I can''t seem to find out how to add rotation/scaling to it using D3DXMatrixTransformation2D or anything else.Any tips?Thanks!cb   int CSprite_D3DX::Draw(){// Build a source RECT which will copy only a small portion of the texture.// Also, you will notice that NumFramesWide is used for both TOP and LEFT// This is correct    srcRect.top    = (( CurrentFrame / NumFramesWide ) * FrameHeight);    srcRect.left   = (( CurrentFrame % NumFramesWide ) * FrameWidth);srcRect.bottom = srcRect.top  + FrameHeight;    srcRect.right  = srcRect.left + FrameWidth;D3DXVECTOR3 vCenter( 0.0f, 0.0f, 0.0f );D3DXVECTOR3 vPosition( (float)x, (float)y, 0.0f );//Add the sprite to the Sprite buffer (actually gets drawn when the Sprite->End executes)D3DSprite->Draw( D3DSpriteTexture, &srcRect, &vCenter, &vPosition, D3DCOLOR_COLORVALUE(Red, Green, Blue, Alpha) );return true;}~ c  o l ec o ~  Rock the cradle of love!You stupid WANKER!S i g n a l D E V .comMetroid Classic
  D3DXMATRIX mat;D3DXMatrixTransformation2D(&mat, ... );pSprite->SetTransform(&mat;pSprite->Draw(pTex, &rect, NULL, NULL, color);xyzzy ;  Thanks!This did the trick:int CSprite_D3DX::Draw(){// Build a source RECT which will copy only a small portion of the texture.// Also, you will notice that NumFramesWide is used for both TOP and LEFT// This is correct    srcRect.top    = (( CurrentFrame / NumFramesWide ) * FrameHeight);    srcRect.left   = (( CurrentFrame % NumFramesWide ) * FrameWidth);srcRect.bottom = srcRect.top  + FrameHeight;    srcRect.right  = srcRect.left + FrameWidth;D3DXVECTOR2 vCenter( 0.0f, 0.0f );D3DXVECTOR2 vScale( scalex, scaley );D3DXVECTOR2 vPosition( (float)x, (float)y );D3DXVECTOR2 vRotationCenter( (float)rotxcenter, (float)rotycenter);D3DXMATRIX mat;D3DXMatrixTransformation2D(&mat,&vCenter,NULL,&vScale,&vRotationCenter,rotation,&vPosition);D3DSprite->SetTransform(&mat);//Add the sprite to the Sprite buffer (actually gets drawn when the Sprite->End executes)D3DSprite->Draw( D3DSpriteTexture, &srcRect, NULL, NULL, D3DCOLOR_COLORVALUE(Red, Green, Blue, Alpha) );return true;}  The only problem now is when I scale LARGER than the original.  It looks fuzzy.  Probably a wrong setting somewhere.  When I scale SMALLER, it is fine.  By fuzzy, I mean anti-aliasing.-cb   ~ c  o l ec o ~  Rock the cradle of love!You stupid WANKER!S i g n a l D E V .comMetroid Classic;quote:Original post by Coleco  The only problem now is when I scale LARGER than the original.  It looks fuzzy.  Probably a wrong setting somewhere.  When I scale SMALLER, it is fine.  By fuzzy, I mean anti-aliasing.The best you can do is set the sampler''s mag filter to something like linear (that is, if you''re using a texture for the sprite, which I assume you are).  So,hr = m_pDevice->SetSamplerState( iState, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR );(or the comparable SetTextureStageState() if you''re using DX8 or lower). I like pie. 