Sign in to follow this  

sprite rotation

Recommended Posts

//start sprite handler sprite_handler->Begin(D3DXSPRITE_ALPHABLEND); D3DXMATRIX matrix; D3DXVECTOR2 scalingCentre=D3DXVECTOR2(0.0f,0.0f); float scalingRotation=timeGetTime()/500.0f; D3DXVECTOR2 spriteCentre=D3DXVECTOR2(0.0f,0.0f); D3DXVECTOR2 trans=D3DXVECTOR2(0.0f,0.0f); D3DXVECTOR2 scaling(1.0f,1.0f); float rotation=timeGetTime()/500.0f; D3DXMatrixTransformation2D(&matrix,&scalingCentre,scalingRotation,&scaling,&spriteCentre,rotation,&trans); sprite_handler->SetTransform(&matrix); //create vector to update sprite position D3DXVECTOR3 position((float)tank.x, (float)tank.y,0.0); D3DXVECTOR3 center(0.0, 0.0, 0.0); RECT rct; rct.left=0; rct.right=32;; rct.bottom=32; //draw the sprite sprite_handler->Draw( tank_image[tank.curframe], &rct, ¢er, &position, D3DCOLOR_XRGB(255,255,255)); I am still trying to get my tank sprite to rotate using direct x and c++.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this