Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

StuartSlater

scaling meshes

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

How can I scale a mesh prior to putting it on the screen, am using Z buffer and find that my mesh dissaperas behind my scene. Thanx Stuart

Share this post


Link to post
Share on other sites
Advertisement

Do you mean something like this
D3DXMatrixScaling( &matScale, 5.0f, 5.0f, 5.0f );



Without 3D, we will be wiping the floor

Share this post


Link to post
Share on other sites
My current code is shown below.

D3DXMatrixRotationY(&rot_matrixy,rot_squarey);
D3DXMatrixRotationX(&rot_matrixx,rot_squarex);
D3DXMatrixMultiply(&rot_matrix,&rot_matrixx,&rot_matrixy);
D3DXMatrixTranslation(&trans_matrix,y2_pos,x2_pos,zpos);
D3DXMatrixMultiply(&matWorld2,&rot_matrix,&trans_matrix);
DXTigerPage.D3DDevice->SetTransform( D3DTS_WORLD, &matWorld2 );


for(DWORD i=0; i {
DXTigerPage.D3DDevice->SetMaterial(&g_pMeshMaterials);
DXTigerPage.D3DDevice->SetTexture(0,g_pMeshTextures[i]);
g_pMesh->DrawSubset(i);
}

My backdrop is a tiled backgrond and my mesh dissapers behind

Share this post


Link to post
Share on other sites

Add this line in the beggining and see if anything changes
D3DXMatrixScaling(&matWorld2, 5.0f, 5.0f, 5.0f );

Share this post


Link to post
Share on other sites
Although be carful since unless you have SetRenderState( D3DRS_NORMALIZENORMALS ,TRUE ) set, your normals will also be scaled, this will affect dynamic lighting if you have it turned on.

Share this post


Link to post
Share on other sites

  • 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!