I'm trying to make a movable model of a robotic arm. I have 5 or so pieces (meshes), and in the D3D mesh viewer (pic 1 below), the meshes appear OK. Also, at runtime, when zoomed in (pic 2 below), the meshes are OK. But when zoomed a little farther out (pic 3 below), the black servos show through the sides of the silver metal links. I was thinking the problem had to do with the z-buffer or lighting, but I am just starting this. My render states are also at the bottom.
Picture 1
Picture 2
Picture 3
Code:
pD3dDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID);
pD3dDevice->SetRenderState(D3DRS_AMBIENT, D3DCOLOR_XRGB(250, 250, 250));
pD3dDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE);
pD3dDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
pD3dDevice->SetRenderState(D3DRS_LIGHTING, TRUE);
pD3dDevice->SetRenderState(D3DRS_NORMALIZENORMALS, TRUE);
pD3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE,TRUE);
pD3dDevice->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_SRCALPHA);
pD3dDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVSRCALPHA);
pD3dDevice->SetTextureStageState(0,D3DTSS_ALPHAARG1,D3DTA_TEXTURE);