Jump to content
  • Advertisement
Sign in to follow this  
derek7

what does this mean?who can explain to me step by step?

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

g_matrixStack->Push(); { g_matrixStack->MultMatrixLocal( &mMoonMatrix ); g_pd3dDevice->SetTransform( D3DTS_WORLD, g_matrixStack->GetTop() ); g_pMoonMesh->DrawSubset(0); } g_matrixStack->Pop();

Share this post


Link to post
Share on other sites
Advertisement
I think this interface is confusing. Instead use std::stack class to create your own stack.


On this one, the documentation is not clear. It seems as if this is happening.


>g_matrixStack->Push();

copies the matrix which is the current stack top and pushes it on stack again.

ABC... --> AABC... (if A was stack top)

>g_matrixStack->MultMatrixLocal( &mMoonMatrix );

replaces the current matrix with the product of the given matrix and the current matrix

AABC --> (moon * A) ABC



> g_pd3dDevice->SetTransform( D3DTS_WORLD, g_matrixStack->GetTop() );

update the world matrix to this new matrix

world = moon * A


>g_pMoonMesh->DrawSubset(0);

draw the mesh now


>g_matrixStack->Pop();

discard current top


(moon * A)ABC --> ABC

Therefore my guess is that in order for this to work, A must be the curretn WORLD Matrix.





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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!