• Advertisement
Sign in to follow this  

mesh transparency and mirroring.

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

Hi, I have a model of a right hand and I would like to: 1. Create a mirror view (to become a left hand). Which transform do I have to set? 2. I would like to display the model semi transparent. ID3DXMesh and its base Interface don't have a method to set transparency. What Should I do? Thanks, Udi Raz

Share this post


Link to post
Share on other sites
Advertisement
I think it would be D3DXMatrixRotationY or D3DXMatrixRotationX. It depends on how your hand is positioned.

On your second question: If you want a transparency effect on your mesh, you must map the model with textures that have an alpha channel. After loading your mesh you shoul set the render state to D3DRS_ALPHABLENDENABLE. Here's the code I'm using when drawing transparent surfaces:

g_d3d_device->SetRenderState(D3DRS_ZENABLE,D3DZB_TRUE);// You might not need this
g_d3d_device->SetRenderState(D3DRS_ZWRITEENABLE, FALSE);
g_d3d_device->SetRenderState(D3DRS_ALPHABLENDENABLE,true);
g_d3d_device->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_SRCALPHA);
g_d3d_device->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVSRCALPHA);
g_d3d_device->SetTextureStageState(0,D3DTSS_ALPHAARG1,D3DTA_DIFFUSE);

[Edited by - Calin on March 29, 2006 10:38:17 AM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement