Jump to content


Need help making my spaceship rotate and translate at the same time


2 replies to this topic

#1 Anddos

    Valued Member

  • Members
  • PipPipPip
  • 161 posts

Posted 04 December 2009 - 03:44 PM

Ive got a mesh loaded that looks like the wipeout ship from the game , now i would of thought if i did d3ddev->SetTransform(D3DTS_WORLD, &(rot * SpaceshipMat)); it would rotate at the same time i press UP arrow and LEFT arrow but it seems it dosent and its either one or the other, can anyone help?

#2 AdrianD

    New Member

  • Members
  • PipPip
  • 27 posts
  • LocationHamburg

Posted 04 December 2009 - 04:56 PM

your problem is either in your matrix setup code or your keyboard input handling code.
you have to provide more infos about your code, when you want to get a more useful answer.

#3 Anddos

    Valued Member

  • Members
  • PipPipPip
  • 161 posts

Posted 05 December 2009 - 07:20 AM

This is how i am handling the key press's

case WM_CHAR:
switch(wParam)
{
case 'f': angle += 0.1f; break;
case 'h': angle -= 0.1f; break;
case 't': SpaceshipPos.z -= 0.5f; break;
case 'g': SpaceshipPos.z += 0.5f; break;
}
break;





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users