Jump to content
  • Advertisement
Sign in to follow this  
Benji385

Newbie to programming

This topic is 2541 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

[font="Arial, sans-serif"][color="#666666"]Hello GameDev.net
[/font]

[font="Arial, sans-serif"] [/font]

[font="Arial, sans-serif"][color="#666666"]I am new to game development (In the sense of programing) and I have recently chosen JAVA as my language of choice for learning programming.[/font]

[font="Arial, sans-serif"] [/font]

[font="Arial, sans-serif"][color="#666666"]I am currently starting a book called "Game Programming for the Evil Genius".[/font]

[color="#666666"][font="Arial, sans-serif"]Which focuses on JAVA [/font][color="#666666"][font="Arial, sans-serif"]exclusively. [/font]

[color="#666666"][font="Arial, sans-serif"] [/font]

[font="Arial, sans-serif"][color="#666666"]However when I finish this book I want to make a small Isometric game in Java.[/font]

[font="Arial, sans-serif"] [/font]

[font="Arial, sans-serif"][color="#666666"]I would want to use the LWJGL but I am unsure at this point.[/font]

[font="Arial, sans-serif"] [/font]

[font="Arial, sans-serif"][color="#666666"]So this is where the Questions start :)[/font]

[font="Arial, sans-serif"] [/font]

[font="Arial, sans-serif"][color="#666666"]What is a Z Buffer?[/font]

[font="Arial, sans-serif"] [/font]

[font="Arial, sans-serif"][color="#666666"]I have heard this term thrown around a few times when it comes to 2D games on LWJGL and I have not been able to find a clear answer. [/font]

[font="Arial, sans-serif"] [/font]

[font="Arial, sans-serif"][color="#666666"]I will have more questions when I get into the meat of the book. :)[/font]

[font="Arial, sans-serif"] [/font]

[font="Arial, sans-serif"][color="#666666"]Thank you for your time[/font]

[font="Arial, sans-serif"] [/font]

[font="Arial, sans-serif"][color="#666666"]Ben[/font]

Share this post


Link to post
Share on other sites
Advertisement

[font="Arial, sans-serif"] [/font]

[font="Arial, sans-serif"][color="#666666"]What is a Z Buffer?[/font]






This helps you to construct a solid 3D scene. P.S. If did you know OpenGL (and Direct3D too) is\are triangle rasterizer(s)....

EXAMPLE: (without Z - Buffer)

Lets draw 2 different triangles (where 1st triangle which is closer to viewer than 2nd triangle (which is behind of 1st triangle)) like this:

1: set up viewer;

2: translateMatrix(in z order);

3: select green color;

3: drawTriangle(); // draws a white triangle

4: translateMatrix(in z order);

3: select red color;

5: drawTriangle(); // draws a red triangle




As a result we would have a red triangle on the screen (but we expected to see a green triangle which is closer to viewer).




NOW we set a use of Z Buffer. And a result is : yes, a green triangle on the screen. (where is a red triangle ?: - behind it)




WHAT HOLDS Z BUFFER?

That holds "z" values (something like "distance from camera/eye" but produced from multiplication of matrix (mvp = ProjectionMatrix * ModelViewMatrix) and input vertex (of primitive)).





There are many references and tutorials over the internet.




Best wishes, FXACE.

Share this post


Link to post
Share on other sites

[quote name='HeadClot_88' timestamp='1324850833' post='4897333']

[font="Arial, sans-serif"] [/font]

[font="Arial, sans-serif"][color="#666666"]What is a Z Buffer?[/font]






This helps you to construct a solid 3D scene. P.S. If did you know OpenGL (and Direct3D too) is\are triangle rasterizer(s)....

EXAMPLE: (without Z - Buffer)

Lets draw 2 different triangles (where 1st triangle which is closer to viewer than 2nd triangle (which is behind of 1st triangle)) like this:

1: set up viewer;

2: translateMatrix(in z order);

3: select green color;

3: drawTriangle(); // draws a white triangle

4: translateMatrix(in z order);

3: select red color;

5: drawTriangle(); // draws a red triangle




As a result we would have a red triangle on the screen (but we expected to see a green triangle which is closer to viewer).




NOW we set a use of Z Buffer. And a result is : yes, a green triangle on the screen. (where is a red triangle ?: - behind it)




WHAT HOLDS Z BUFFER?

That holds "z" values (something like "distance from camera/eye" but produced from multiplication of matrix (mvp = ProjectionMatrix * ModelViewMatrix) and input vertex (of primitive)).





There are many references and tutorials over the internet.




Best wishes, FXACE.
[/quote]

Hey thanks for the in depth explanation of what the Z Buffer is.

Really Appreciate it :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!