# 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.

## 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 on other sites

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

1. 1
Rutin
23
2. 2
3. 3
JoeJ
20
4. 4
5. 5

• 29
• 40
• 23
• 13
• 13
• ### Forum Statistics

• Total Topics
631740
• Total Posts
3001965
×