Jump to content
  • Advertisement

chris.sermanni

Member
  • Content Count

    4
  • Joined

  • Last visited

Community Reputation

100 Neutral

About chris.sermanni

  • Rank
    Newbie
  1. chris.sermanni

    how to Rotate Model

    Hi every one ... i want to rotate my 3dmodel in roll-pitch-yaw axis i have just axis(x,y,z) vector and up(x,y,z) vector so how to rotate my model by axis(x,y,z) vector + up(x,y,z) vector values? please lookout my simple code... D3DXVECTOR3 * axis=new D3DXVECTOR3; axis->x = -0.14; axis->y = -0.99; axis->z = -0.04; D3DXVECTOR3 * up=new D3DXVECTOR3; up->x = -0.99; up->y = 0.14; up->z = 0.07; D3DXMATRIXA16 mWorld; /////////////////////////////////////////////////////////////////// D3DXMatrixLookAtLH(&mWorld,g_Camera.GetEyePt(),axis,up); //////////////////////////////////////////////////////////////////// mWorld *= *g_Camera.GetWorldMatrix(); D3DXMATRIXA16 mProj; mProj = *g_Camera.GetProjMatrix(); D3DXMATRIXA16 mView; mView = *g_Camera.GetViewMatrix(); D3DXMATRIXA16 mWorldViewProjection; mWorldViewProjection = mWorld * mView * mProj; V( g_pEffect9->SetMatrix( g_hmWorldViewProjection, &mWorldViewProjection ) ); is there any way or formula to convert : [size="1"]axis(x,y,z) & up(x,y,z) vectors to (roll - pitch - yaw) ? also you know we need use "axis" and "up" vector both together to calculate. because in some direction of y we must change place of x value by z ....
  2. chris.sermanni

    Rotate Model

    [size="4"] is there any way or formula to convert : [size="5"]axis(x,y,z) & up(x,y,z) vectors to (roll - pitch - yaw) ? also you know we need use "axis" and "up" vector both together to calculate. because in some direction of y we must change place of x value by z ....
  3. chris.sermanni

    Rotate Model

    thanks for your answer Molle85 can you please show me how to use it ? i try to do it myself but model not rotate in a true direction.... D3DXVECTOR3 * axis=new D3DXVECTOR3; axis->x = -0.14; axis->y = -0.99; axis->z = -0.04; D3DXVECTOR3 * up=new D3DXVECTOR3; up->x = -0.99; up->y = 0.14; up->z = 0.07; D3DXMATRIXA16 mWorld; /////////////////////////////////////////////////////////////////// D3DXMatrixLookAtLH(&mWorld,g_Camera.GetEyePt(),axis,up); //////////////////////////////////////////////////////////////////// mWorld *= *g_Camera.GetWorldMatrix(); D3DXMATRIXA16 mProj; mProj = *g_Camera.GetProjMatrix(); D3DXMATRIXA16 mView; mView = *g_Camera.GetViewMatrix(); D3DXMATRIXA16 mWorldViewProjection; mWorldViewProjection = mWorld * mView * mProj; V( g_pEffect9->SetMatrix( g_hmWorldViewProjection, &mWorldViewProjection ) );
  4. chris.sermanni

    Rotate Model

    Hi every one ... i want to rotate my 3dmodel in roll-pitch-yaw axis i have just axis(x,y,z) vector and up(x,y,z) vector so how to rotate my model by axis(x,y,z) vector + up(x,y,z) vector values? please lookout my simple code... D3DXVECTOR3 * axis=new D3DXVECTOR3; axis->x = -0.14; axis->y = -0.99; axis->z = -0.04; D3DXVECTOR3 * up=new D3DXVECTOR3; up->x = -0.99; up->y = 0.14; up->z = 0.07; D3DXMATRIXA16 mWorld; /////////////////////////////////////////////////////////////////// D3DXMatrixRotationAxis(&mWorld,axis,180); //is true ? D3DXMatrixRotationAxis(&mWorld,up,180); // is true ? //////////////////////////////////////////////////////////////////// mWorld *= *g_Camera.GetWorldMatrix(); D3DXMATRIXA16 mProj; mProj = *g_Camera.GetProjMatrix(); D3DXMATRIXA16 mView; mView = *g_Camera.GetViewMatrix(); D3DXMATRIXA16 mWorldViewProjection; mWorldViewProjection = mWorld * mView * mProj; V( g_pEffect9->SetMatrix( g_hmWorldViewProjection, &mWorldViewProjection ) );
  • 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!