• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

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

Kentamanos

DX7 SDK Sample question

10 posts in this topic

Rules for reading MS Sample apps.
1) Don't.

That's it. From all the samples I've read in the DX6 sdk, I can't think of one that didn't confuse me even more than I was when I started. I will admit that I haven't yet had time to look at the DX7 apps, but I am willing to bet that rule #1 is here to stay.

0

Share this post


Link to post
Share on other sites
I have to disagree. I don't like how the samples are programed, but you can still learn alot from them. It might take a while, but once you figure out their programming standards the samples can be very helpful.

Just make sure that you don't try and learn from the samples alone, and also take a look at the SDK Docs.

--TheGoop

0

Share this post


Link to post
Share on other sites
Yeah, sometimes the samples are really ugly, but, for example, if I see the particle sample for D3DX, I just wanna read the code because it looks great. I learned most from reading through the sources, I use another style, but get knowing what to do when is easy when reading through many sample codes.

CU

------------------
Skullpture Entertainment
#40842461

0

Share this post


Link to post
Share on other sites
I beleive that the D3DX utilty library takes care of initializing the matrices. And that example is used to show the basics of D3DX.
0

Share this post


Link to post
Share on other sites
The triagle is black because the sample writer forgot to enable the D3DRENDERSTATE_COLORVERTEX render state. As the D3D docs state:

Other than these requirements, you have the flexibility to use, or disregard, the other vertex components. For example, if you want to include a diffuse or specular color with your untransformed vertices, you can. (This wasn't possible before DirectX 6.0). Including individual colors for each vertex makes it possible to achieve shading effects that are much more subtle and flexible than lighting calculations that use only the material color. Keep in mind that you must enable per-vertex color through the D3DRENDERSTATE_COLORVERTEX render state. Untransformed, unlit vertices can also include up to eight sets of texture coordinates.

0

Share this post


Link to post
Share on other sites
Hmm, was wondering that myself. Thing is, I seem to remember using colored vertices in a D3DLVERTEX structure before and getting the proper results. Stupid Microsoft been screwing with default render states? Oy, hope they didn't mess up anything else I count on...
0

Share this post


Link to post
Share on other sites
The COLORVERTEX did not do it. Apparently that state defaults to true. I am still clueless as to why it is black...

------------------

-Kentamanos

0

Share this post


Link to post
Share on other sites
It turns out that the renderstate called LIGHTING defaults to TRUE, meaning that DX will apply it's lighting model to renderings. You have to called SetRenderState to set the D3DRENDERSTATE_LIGHTING to FALSE.

As far as the matrices go, the World and View matrices default to identity, and the projection defaults to a 45 degree view supposedly. I still don't know where this is documented.

------------------

-Kentamanos

0

Share this post


Link to post
Share on other sites
Default values for matrices in D3DX is documented in the SDK Help under Direct3D\Direct3DX Utility Library\Reference\Functions\General Purpose Functions\D3DXCreateContextEx .

The reason for the lighting is that D3D lighting is being applied to the primitive in addition to the vertex colors. And in D3D 7 the default material is all black, which, when modulated with the vertex colors comes out black.

0

Share this post


Link to post
Share on other sites
I am looking at a sample in the DX7 SDK. The sample is TrivFS (although the same exact questions are the same for the TrivWin windowed version). This sample is under their D3DX section, and gets installed in your start menu.

The sample uses the vertex format D3DFVF_LVERTEX, which indicates the vertices are pre-lit (they do not have DX apply lighting to them), but are untransformed. In otherwords the vertices use a set color and the vertices are in model coordinates. The 3 vertices for the triangle have diffuse colors of red, green, and blue.

So I have 2 questions:
1) Why is the triangle black? Shouldn't the format of the vertex just make the color of these vertices red, green, and blue. I expected a blended triangle.

2) Do the World, View, and Projection matrices have default values? SetTransform is NEVER called in this example.

Can someone please tell me what I am missing here? I am a newbie to D3D, and this one has me stumped.

------------------

-Kentamanos

0

Share this post


Link to post
Share on other sites
I was a littled puzzled about the differences between DX6.x and DX7 until I read this from Tim Sweeney:

"The API's simplicity has also improved, which is something you don't often see: usually code just gets more complex as it evolves. Porting Unreal Tournament's code from DirectX6 to DirectX7 only took 3.5 hours, and mostly consisted of deleting now-redundant code and changing function calls and interfaces. I'm very glad to see the IDirect3DTexture, IDirect3DViewport, and IDirect3DLight interfaces gone, and replaced by much simpler state-setting code. Direct3D's abuses of object-oriented programming are now gone."

What an insightful dude!

0

Share this post


Link to post
Share on other sites