#### Archived

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

# looking for D3DIM7 tutorials...

This topic is 6495 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I feel that I have mastered DirectDraw enough, so I am moving on to D3DIM. I am currently reading Teach Yourself DirectX 7 in 24 Hours (the title is very misleading, but hey, thats what I expected. Maybe in 24 months:p). Anyway, I already understand how to initialize D3D, but I am a bit fuzzy on the concept of indexing a primitive. Is anyone aware of any tutorials using indexed primitives to put a simple, non-textured, pre lit triangle on the screen? If not, I guess I will just have beat my head senseless trying to make sense of the book (or die trying).

##### Share on other sites
Moe,

You need to look no further than the tutorials on this very site. Simply hit the "programming" and then the "DirectX" links and you''ll find yourself some excellent tutorials on using DirectX 7 IM.

Regards,

Dean M.

##### Share on other sites
i am excactly in the same situation as you!
but i didn''t find any very useful tutorials in the net, at least none covering d3dim basics.
i''d recommend the microsoft documentation, although it comes from microsoft, it really explains the basics very good, and together with some 3d-matrix-math tutorials from the net you can come quite far i think.
by the way, be sure to look at the sdk samples, they also help you a lot.

hope that helps to get you started
rid

##### Share on other sites
Indexed primitives are essentially where you define all the vertices in the primitive, ie What you want to draw. Each vertex has a number, which we shall call an index. Now, when we define the actual shape of the primitive in terms of triangles, instead of constructing the primitive from the actual vertices, we construct it from the indexes to the vertices. For example, a square. If we define it as a triangle list, we get a total of six vertices. Now, two of those are totally unneccessary as they are the same as other vertices, so we use an indexed primitive. Vertex 1 is (-30, 30, 0), Vertex 2 is (30, 30, 0), Vertex 3 is (-30, -30, 0), and Vertex 4 is (30, -30, 0). If you draw this you can see it makes a square centered on the origin. Now, to describe this as an indexed primitive, instead of giving the actual vertices, we just give indices. So the array of vertices in the triangle list goes 1, 3, 2, 2, 3, 4 . This list is two triangles which make a square but because it is indexed it only needs 4 vertices, not six, eliminating two vertices from all transformations.

If you look at any 3d engine, you will most usually find it uses indexed primitives, as they are faster because fewer points need be transformed.

I hope I have helped you comprehend indexing a primitive. Feel free to ask me questions about it.

------------------------------
#pragma twice

##### Share on other sites
I understand what indexed primitives are, but I am not so sure how to fill out the array of vertices. The book I have uses a for loop to fill out the array. Since the book is aimed at beginners, I think they should have filled each one out, one at a time. Anyway, thanks for your help.

1. 1
Rutin
23
2. 2
3. 3
JoeJ
20
4. 4
5. 5

• 28
• 40
• 23
• 13
• 13
• ### Forum Statistics

• Total Topics
631738
• Total Posts
3001950
×