Thread: C++ DirectX 9 3D z-buffer issues?

  1. #1
    Registered User
    Join Date
    Mar 2006
    Posts
    1

    C++ DirectX 9 3D z-buffer issues?

    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);

  2. #2
    Registered User
    Join Date
    Feb 2008
    Posts
    1
    hi jrbarr,

    Are you still having this issue? If not, how did you resolve it?

    Hamfiend

  3. #3
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    I seriously doubt that jrbarr is ever going to see this thread again, but you might try elsewhere. Some searching revealed these:
    http://www.robotsrule.com/phpBB2/vie...dae8341613#329
    http://forums.devx.com/showthread.php?t=149614

    Looks like some java was involved . . . .
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  4. #4
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Wow nearly a 2 year bump.

    Closed.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Wiki FAQ
    By dwks in forum A Brief History of Cprogramming.com
    Replies: 192
    Last Post: 04-29-2008, 01:17 PM
  2. Simple (?) problem rendering a vertex buffer
    By Dark_Phoenix in forum Game Programming
    Replies: 4
    Last Post: 08-11-2007, 07:32 PM
  3. Isometric Tile Engine using DirectX
    By Wraithan in forum Game Programming
    Replies: 3
    Last Post: 07-17-2006, 12:16 PM
  4. Directx issues
    By dpro in forum Game Programming
    Replies: 7
    Last Post: 03-30-2005, 01:58 PM
  5. Tetris Questions
    By KneeGrow in forum Game Programming
    Replies: 19
    Last Post: 10-28-2003, 11:12 PM