Sign in to follow this  

multiple transform

Recommended Posts

Hy. II have 2 meshes and i would scale the first of 3 unit , the second of -1 uni i have the tree meshes in a vector and i do this:
std::vector<CMeshBase*>::iterator itMesh; for(itMesh = m_AllMeshes.begin();itMesh != m_AllMeshes.end();itMesh++) { Device->SetMaterial(&mtrl); CMeshBase* pmesh=((CMeshBase*)*itMesh); if(pmesh->getName().find("B-floor-mesh")!=string::npos ) { D3DXMatrixRotationX(&pmesh->mxRotate,-240); D3DXMatrixTranslation(&pmesh->mxTranslate,5.234062 ,-1.04631 ,0.148801); D3DXMatrixScaling(&pmesh->mxScale,3,3,3); Device->SetTransform(D3DTS_WORLD,&pmesh->mxScale); pmesh->mesh->DrawSubset(0); } if(pmesh->getName().find("F430")!=string::npos) { D3DXMatrixRotationX(&pmesh->mxRotate,-180); D3DXMatrixTranslation(&pmesh->mxTranslate,-0.676137 ,0.016215 ,0.56571); D3DXMatrixScaling(&pmesh->mxScale,-1,-1,-1); D3DXMATRIX World=pmesh->mxRotate*pmesh->mxTranslate*pmesh->mxScale; Device->SetTransform(D3DTS_WORLD, &World); pmesh->mesh->DrawSubset(0); } }
but this apply only the last transformation why? How i cand do this with directx9? THanks

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this