Skip to main content
GameDev.net gamedev.net
🔒 Locked

Newbie to programming

Started by Benji385 Dec 25, 2011 at 10:07 PM 1 replies 1.1k views
Original Post
Benji385
Benji385

[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]

FXACE
FXACE

[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.
Benji385
Benji385

[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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.