Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

hey,

i created a mesh program thingy,

the only way i got it to work was if i changed:

 

D3Ddev.Clear(ClearFlags.Target Or ClearFlags.ZBuffer, Color.FromArgb(0, 20, 0), 0, 0)

to

D3Ddev.Clear(ClearFlags.Target Or ClearFlags.ZBuffer, Color.FromArgb(0, 20, 0), 1, 0)

 

that argument(Changing from 0 to 1) is the ZDepth,

does anyone know what this argument does? Becuase if it was 0, the mesh wouldnt be displayed at all

My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!)

vbprogramming.8k.com

My Project (Need VB.NET Programmers)

http://workspaces.gotdotnet.com/ResolutionRPG

Posted
That is the value you initialize z-buffer with. It ranges typically from 0 (front) to 1 (back). It is used internally to determine if the new stuff should be rendered. It is rendered only if its depth is closed to camera than z-values already in the z-buffer. So when you set it to 0 you effectively said that there is a plane right in front of the camera meaning that nothing behind it could be seen.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...