Jump to content
  • Advertisement
Sign in to follow this  

Moving Airplane?

This topic is 3894 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

I was wondering if someone could tell me what I am doing wrong. Is there a better way to do a simulation of an airplane? Here is the code that I got: _yaw += _currentTurn; _pitch -= (float)(_currentElevation * cos(_yaw)); Then move forward like this void SpaceCraft::moveCraft(float speed) { D3DXMatrixTranspose( &m_matrix, &m_matrix ); D3DXVECTOR3 vForwards( 0, 0, 0 ); D3DXVec3TransformCoord( &vForwards, &vForwards, &m_matrix ); D3DXVECTOR3 vCurrent(_x, _y, _z); D3DXVec3Normalize(&vForwards, &vForwards); vForwards.x += sin(_yaw) * cos(_pitch) * speed; vForwards.y -= sin(_pitch) * speed; vForwards.z += cos(_yaw) * cos(_pitch) * speed; vCurrent += vForwards * speed; _x = vCurrent.x; _y = vCurrent.y; _z = vCurrent.z; setMatrix(); } [Edited by - carterwjeff on December 8, 2007 5:29:55 PM]

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!