this is the code from a method i use to draw my sprites:
D3DXMATRIX matRotate;
D3DXVECTOR2 center( Center.X , Center.Y );
D3DXVECTOR2 position( Position.X , Position.Y );
D3DXVECTOR2 scale( 1, 1 );
D3DXMatrixTransformation2D( &matRotate, NULL, NULL, &scale, ¢er, 0, &position);
PV_SpriteRenderer->SetTransform( &matRotate );
PV_SpriteRenderer->Draw( PV_Texture, pSrcRect, NULL, NULL, D3DCOLOR_XRGB( 255, 255, 255 ) );
D3DXMatrixRotationZ( &matRotate, 0 );
PV_SpriteRenderer->SetTransform( &matRotate );
does this help ?
Unfortunately not. The code achieves what I already have. Everything is drawn in the right position, the sprite appears rotated, the walls appear the right way up, BUT the axis for the world seem to be rotated in some way. When I hold right to move right, the sprite moves diagonally towards the bottom left if I have rotated a bit clockwise.
There has to be a simple answer to this, there must be something obvious I'm doing wrong here. Is how I am doing my movement wrong? I have my sprite store in a D3DXVECTOR3, it's x and y coordinates (z is there in case I wanted to do layers or some such, but it's just 0, this is why I do player01.coordinates.x, etc). When I hold right, I increment that value by a speed variable. I then draw my sprite using this:
g_pD3DXSprite->Draw(player01.returnTexture(), NULL, &D3DXVECTOR3(0,0,0), &player01.coordinates, 0xffffffff);
What AM I doing wrong? Should I be using something other than ID3DXSprite to draw my sprites? Is there another way? Do I need to find out how to write some new different way of drawing images to the screen in a way that doesn't transform their axis?