Jump to content
  • Advertisement
Sign in to follow this  
lidongheng

How Understand the code in My topic

This topic is 2708 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 really need somebody's help My Math is So bad I don't understand some code in the below did somebody can slove my problem
// Ensure that the view movement is relative to the rotation.
D3DXVec3TransformCoord( &m_viewPoint, &m_viewPoint, GetRotationMatrix() );


// Only calculate the correct view matrix if it is being used.
if( m_isViewing == true )
{
// Create the x axis rotation matrix.
D3DXMATRIX rotationXMatrix;
D3DXMatrixRotationX( &rotationXMatrix, m_viewTilt );


// Create the combined rotation matrix (i.e. y axis rotation from the
// scene object plus the x axis rotation from the player object).
D3DXMATRIX combinedRotation;
D3DXMatrixMultiply( &combinedRotation, &rotationXMatrix, GetRotationMatrix() );


// Build a translation matrix that represents the final view point.
D3DXMATRIX viewPointTranslationMatrix;
D3DXVECTOR3 finalViewPointTranslation = GetTranslation() + m_viewPoint;
D3DXMatrixTranslation( &viewPointTranslationMatrix, finalViewPointTranslation.x, finalViewPointTranslation.y, finalViewPointTranslation.z );
something like he use some vector knowlege i don't know How to understand vector?


Share this post


Link to post
Share on other sites
Advertisement

i really need somebody's help My Math is So bad I don't understand some code in the below did somebody can slove my problem
// Ensure that the view movement is relative to the rotation.
D3DXVec3TransformCoord( &m_viewPoint, &m_viewPoint, GetRotationMatrix() );


// Only calculate the correct view matrix if it is being used.
if( m_isViewing == true )
{
// Create the x axis rotation matrix.
D3DXMATRIX rotationXMatrix;
D3DXMatrixRotationX( &rotationXMatrix, m_viewTilt );


// Create the combined rotation matrix (i.e. y axis rotation from the
// scene object plus the x axis rotation from the player object).
D3DXMATRIX combinedRotation;
D3DXMatrixMultiply( &combinedRotation, &rotationXMatrix, GetRotationMatrix() );


// Build a translation matrix that represents the final view point.
D3DXMATRIX viewPointTranslationMatrix;
D3DXVECTOR3 finalViewPointTranslation = GetTranslation() + m_viewPoint;
D3DXMatrixTranslation( &viewPointTranslationMatrix, finalViewPointTranslation.x, finalViewPointTranslation.y, finalViewPointTranslation.z );
something like he use some vector knowlege i don't know How to understand vector?





You don't actually say what your problem is, other than "I don't understand" Do you know what a vector is? Do you know what a matrix is? If you answered no, get a book on linear algebra, or any book on 3D games programming. Do you understand the Functions used, like D3DXMatrixMutiply or D3DXVec3TransformCoord? If not, then checkout MSDN. If neither applies, then you need to provide more information in regards to what your problem is

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!