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

New to 3D Game Engine Programming

Started by LeLorrain May 12, 2011 at 6:28 PM 5 replies 1.8k views
Original Post
LeLorrain
LeLorrain
I just finished going through the code of Chapter 6 but there is an aspect that bugs me. I do not understand how the various methods in ZFXD3Dmisc.cpp are used... in particular, in InitStage, the 3D perspective and orthogonal matrices are computed, but there is no definition of the near and far planes that are used in the computation! Nowhere in the chapter are there any indications on when the View and Projection matrices are created; SetView3D just update existing matrices, SetClipping Planes too!

Should'nt the sequence of call be:

InitStage (Initialize the with default values)
SetMode (Setup the D3D viewport)

then a call to create the view and projection matrices followed by:

SetView3D (Modify the matrices)
SetClipping (Modify the matrices)

What am I missing? The rest of the chapter is about Shader and Vertex rendering.

Thanks,

LeLorrain
NEXUSKill
NEXUSKill
you are missing mentioning the chapter 6 of what book you got stuck on

Game making is godlike

LinkedIn profile: http://ar.linkedin.com/pub/andres-ricardo-chamarra/2a/28a/272


Burnt_Fyr
Burnt_Fyr

I just finished going through the code of Chapter 6 but there is an aspect that bugs me. I do not understand how the various methods in ZFXD3Dmisc.cpp are used... in particular, in InitStage, the 3D perspective and orthogonal matrices are computed, but there is no definition of the near and far planes that are used in the computation! Nowhere in the chapter are there any indications on when the View and Projection matrices are created; SetView3D just update existing matrices, SetClipping Planes too!

Should'nt the sequence of call be:

InitStage (Initialize the with default values)
SetMode (Setup the D3D viewport)

then a call to create the view and projection matrices followed by:

SetView3D (Modify the matrices)
SetClipping (Modify the matrices)

What am I missing? The rest of the chapter is about Shader and Vertex rendering.

Thanks,

LeLorrain


Well You could always step through the code... I gave up on that book myself, only because I was working with a newer sdk, which meant half of the code was broken, and I wasn't adept enough to figure out why at that point in time. IMO his later book is much better, but that could just be because I understand so much more of what is going on than before.
LeLorrain
LeLorrain

you are missing mentioning the chapter 6 of what book you got stuck on <img alt=";)" class="bbc_emoticon" src="http://public.gamedev.net/public/style_emoticons/<#EMO_DIR#>/wink.gif"/>







Sorry, I thought that the heading of the message was enough... the book is "3D Game Engine Programming" by Stefan Zerbst & Oliver Düvel.
LeLorrain
LeLorrain

[quote name='LeLorrain' timestamp='1305224939' post='4809887']
I just finished going through the code of Chapter 6 but there is an aspect that bugs me. I do not understand how the various methods in ZFXD3Dmisc.cpp are used... in particular, in InitStage, the 3D perspective and orthogonal matrices are computed, but there is no definition of the near and far planes that are used in the computation! Nowhere in the chapter are there any indications on when the View and Projection matrices are created; SetView3D just update existing matrices, SetClipping Planes too!

Should'nt the sequence of call be:

InitStage     (Initialize the with default values)
SetMode     (Setup the D3D viewport)

then a call to create the view and projection matrices followed by:

SetView3D     (Modify the matrices)
SetClipping (Modify the matrices)

What am I missing? The rest of the chapter is about Shader and Vertex rendering.

Thanks,

LeLorrain


Well You could always step through the code... I gave up on that book myself, only because I was working with a newer sdk, which meant half of the code was broken, and I wasn't adept enough to figure out why at that point in time. IMO his later book is much better, but that could just be because I understand so much more of what is going on than before.
[/quote]




I have the 2004 edition which uses the SDK of D3D9c (Which is the SDK I have)

I do intend to continue looking at the code, it is just that I do not like to do something without understanding why I am doing it and to what purpose... and the way these methods are presented do not make sense to me. Also the demo sample given on the CD is not very enlightening for that matter.

Topic Locked

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

Sign in to reply to this topic.