Jump to content

  • Log In with Google      Sign In   
  • Create Account

Problem with z-buffer


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Zen42   Members   -  Reputation: 122

Like
Likes
Like

Posted 02 October 1999 - 06:26 AM

Hi everybody!

I am just starting to learn Direct3D (Immediate Mode) and did the first tutorial in MS DirectX SDK 6 (The triangle tutorial).

Besides the fact, that this tutorial is worse than anything I have ever seen before (I liked the DirectDraw tutorials much better), I went through it. I made some changes (Fullscreen mode with backbuffer and flipchain).

Then I tried the second tutorial (z-buffer) and everything went fine until I started what I coded. If I turn on the z-buffer with g_pD3DDevice->SetRenderState() I can just see some lines moving across the screen. When I turn it off all is fine except that z-buffering is off and so the output is without hidden surface removal.

(Maybe this can be helpful: Like in the first tutorial I made some changes like fullscreen mode, backbuffer in VIDMEM and a flipping chain)

I can't get, what I did wrong, so I am trying my luck in this message board. As posting my sourcecode would be not such a good idea (it's simply too long) I put a link in here, where you can find it.
http://www.rzuser.uni-heidelberg.de/~tpastuch/code/d3d.txt

If someone has the time to have look at it and could analyze it, I would be very glad. (I can understand, if you don't want to, since my coding style is not the best )

Many thanks in advance...

...Bye


Sponsor:

#2 Shinkage   Members   -  Reputation: 595

Like
Likes
Like

Posted 02 October 1999 - 06:26 AM

Clear your z-buffer.

g_pD3DViewport->Clear2(1UL, &ViewportRect, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x000000ff, 1.0f, 0L);





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS