Results 1 to 3 of 3

Thread: Direct 3d...

  1. #1

    Thread Starter
    Fanatic Member petrus's Avatar
    Join Date
    May 2002
    Location
    pBytes[sizeof(pBytes)/2]
    Posts
    553

    Direct 3d...

    Hello,
    I have four triangles forming two squares, one square is in front of the other.
    When I rotate the world, so that the square that was in front of the other is now (should be) the one who is back, it gets weird, the square that was in front first is still in front! But, the square is much smaller than the other.
    How should I deal with this?
    I have tried with using

    d3ddev->SetRenderState( D3DRS_ZENABLE,D3DZB_TRUE);
    but it only crashes the computer
    ICQ: 128716725

  2. #2
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    You have to create your device with a zbuffer:
    Code:
    d3dpp.EnableAutoDepthStencil = 1
    d3dpp.AutoDepthStencilFormat = D3FMT_D16
    You can then enable the ZBuffer (as you were trying to do above.

    Z.

  3. #3

    Thread Starter
    Fanatic Member petrus's Avatar
    Join Date
    May 2002
    Location
    pBytes[sizeof(pBytes)/2]
    Posts
    553
    OK!
    I have done a cube with a triangle strip, else the texture would get wrong, but I can't manage to make the top and bottom of the cube...
    Should I render them as an other object?
    ICQ: 128716725

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width