Jump to content
  • Advertisement
Sign in to follow this  

sprite rotation

This topic is 3670 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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.top=0; 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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!