Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

dbunder

Various newbie questions

This topic is 5360 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

Very new to game and graphics programming. Been learning for a couple weeks. I'm reading Beginning Direct3D Game Programming by W.F. Engel., and while I've understood most everything in the book, it's one of the worst programming books I've ever read. The "Beginning" in the title shouldn't be there. The concepts accelerate way too quickly and he glazes over every detail that's probably awfully important. The book assumes that you know entirely too much and I've had to go through tons of other references and examples to parse what the author means. A bit too much explanation, so let's get to the actual questions... 1) I'm at a chapter on advanced texturing. Multitexturing, texture wrapping, texture coordinates, etc. Everything is pretty simple until it gets to texture-addressing modes. He shows a couple of examples, says what they do, but doesn't explain anything about them. Completely stuck here. Here's an example... You have a texture that you want to repeat across the screen. You use: VERTEX vertices[] = { // x,y,z,rhw,tu,tv { 0.0f, (float)m_d3dsdBackBuffer.Height, 0.5f, 1.0f, -0.5f, 1.5f, }, { 0.0f, 0.0f, 0.5f, 1.0f, -0.5f, -0.5f, }, { (float)m_d3dsdBackBuffer.Width, (float)m_d3dsdBackBuffer.Height, 0.5f, 1.0f, 1.5f, 1.5f, }, { (float)m_d3dsdBackBuffer.Width, 0.0f, 0.5f, 1.0f, 1.5f, -0.5f }, }; m_pd3dDevice->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP); m_pd3dDevice->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP); This apprently will repeat the texture in the window 3 times on the x axis and 3 times on the y axis. Why? I don't see anything in there that would represent 3 of anything. I'm likely just reading it wrong, but it just looks like nonsense to me, and no explanation of it is given. There's a similar example that will repeat the texture 3 times in a half-whole-whole-half pattern on the x axis and 5 times on the y axis. No rhyme or reason to that one, either. What am I missing? 2) What happened to D3DUtil_InitLight() and D3DUtil_InitMaterial() in the Direct3D framework? The book uses DirectX 9.0 as of early 2003. I'm using the Summer 2003 update and no such utility functions exist. I was able to write my own using the Microsoft samples, just curious. Are there any replacements for these? 3) Another shortcoming of the book: index buffers. I understand what their purpose is and what they do, but I'm kinda confused on the implementation side of things. Theres an example in the book of creating a simple 7-vertex spaceship. In the code it shows him setting up the index buffers manually, line by line. For a simple 4-vertex model this wouldn't be hard. But for an 8-vertex model or a 127-vertex model? Unruly. Do plugins for the various modeling programs (maya, 3dsmax, milkshape) that export to .x files take care of the vertex indexing for you? Please tell me yes. If no, what's a generally accepted method of figuring this out? 4) How efficient is the directx common graphics archetecture? Is it commonly used by large game developers, or is it just there to give you a general idea on how to do various things? Just another curiousity. I think that's it for now... I'll probably have more questions along my long journey into game programming. But this should cover it. Thanks for any help, and please excuse the ginormous post. [edited by - dbunder on April 14, 2004 12:05:06 AM] [edited by - dbunder on April 14, 2004 12:05:47 AM] [edited by - dbunder on April 15, 2004 4:25:38 AM] [edited by - dbunder on April 15, 2004 4:31:57 AM]

Share this post


Link to post
Share on other sites
Advertisement
quote:
Original post by dbunder
2) What happened to D3DUtil_InitLight() and D3DUtil_InitMaterial() in the Direct3D framework? The book uses DirectX 9.0 as of early 2003. I''m using the Summer 2003 update and no such utility functions exist. I was able to write my own using the Microsoft samples, just curious. Are there any replacements for these?



IIRC util libs were never part of DirectX but are a common lib for the samples MS supplies. So replacing with the ones found in the samples should be fine.

Share this post


Link to post
Share on other sites

  • 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!