Sign in to follow this  
Benji385

Newbie to programming

Recommended Posts

Benji385    100
[left][font="Arial, sans-serif"][size="2"][color="#666666"]Hello GameDev.net
[/color][/size][/font][/left][left][font="Arial, sans-serif"] [/font][/left][left][font="Arial, sans-serif"][color="#666666"][size="2"]I am new to game development (In the sense of programing) and [/size][size="2"]I have recently chosen JAVA as my language of choice for learning programming.[/size][/color][/font][/left][left][font="Arial, sans-serif"] [/font][/left][left][font="Arial, sans-serif"][color="#666666"][size="2"]I am currently starting a book called "Game Programming for the Evil Genius".[/size][/color][/font][/left][left][color="#666666"][font="Arial, sans-serif"][size="2"]Which focuses on JAVA [/size][/font][/color][color="#666666"][font="Arial, sans-serif"][size="2"]exclusively. [/size][/font][/color][/left][left][color="#666666"][font="Arial, sans-serif"] [/font][/color][/left][left][font="Arial, sans-serif"][color="#666666"][size="2"]However when I finish this book I want to make a small Isometric game in Java.[/size][/color][/font][/left][left][font="Arial, sans-serif"] [/font][/left][left][font="Arial, sans-serif"][size="2"][color="#666666"]I would want to use the LWJGL but I am unsure at this point.[/color][/size][/font][/left][left][font="Arial, sans-serif"] [/font][/left][left][font="Arial, sans-serif"][size="2"][color="#666666"]So this is where the Questions start :)[/color][/size][/font][/left][left][font="Arial, sans-serif"] [/font][/left][left][font="Arial, sans-serif"][size="2"][color="#666666"]What is a Z Buffer?[/color][/size][/font][/left][left][font="Arial, sans-serif"] [/font][/left][left][font="Arial, sans-serif"][color="#666666"][size="2"]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. [/size][/color][/font][/left][left][font="Arial, sans-serif"] [/font][/left][left][font="Arial, sans-serif"][size="2"][color="#666666"]I will have more questions when I get into the meat of the book. :)[/color][/size][/font][/left][left][font="Arial, sans-serif"] [/font][/left][left][font="Arial, sans-serif"][size="2"][color="#666666"]Thank you for your time[/color][/size][/font][/left][left][font="Arial, sans-serif"] [/font][/left][left][font="Arial, sans-serif"][size="2"][color="#666666"]Ben[/color][/size][/font][/left]

Share this post


Link to post
Share on other sites
FXACE    182
[quote name='HeadClot_88' timestamp='1324850833' post='4897333'][left][font="Arial, sans-serif"] [/font][/left][left][font="Arial, sans-serif"][size="2"][color="#666666"]What is a Z Buffer?[/color][/size][/font][/left][/quote]




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
Benji385    100
[quote name='FXACE' timestamp='1324857506' post='4897358']
[quote name='HeadClot_88' timestamp='1324850833' post='4897333'][left][font="Arial, sans-serif"] [/font][/left][left][font="Arial, sans-serif"][size="2"][color="#666666"]What is a Z Buffer?[/color][/size][/font][/left][/quote]




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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this