Primitives Tutorials

This category of tutorials is designed to teach you the basics of drawing primitives in XNA. Primitives, like triangles and lines, are the building blocks of 3D drawing. In the 3D tutorials, we learned how to draw 3D models, which gets us a very long way. However, sometimes, we want to be able to draw stuff without having to use a Model. For instance, we may have terrain that we generated in our game. It wasn't loaded into as a model, and so we will need to know how to draw our terrain ourselves. These tutorials will teach you how to draw primitives including triangles and lines, and we will also discuss index buffers, which allow us to draw things a lot faster.


1 - Drawing Triangles

Primitives are the basic building blocks of all 3D drawing. By far the most common kind of primitive is a triangle. Virtually everything you do in 3D is actually made up of lots of tiny triangles. This tutorial will teach you the basic method of drawing triangles in XNA.
Drawing Triangles


2 - A Little Practice

Understanding how triangles are drawn is important. We will spend a little more time drawing triangles here before moving on. This time we will draw some more sophisticated objects that are made out of triangles.
A Little Practice


3 - Index and Vertex Buffers

Vertex and index buffers allow us to store data on the graphics card and store that data in a fairly efficient manner. In this tutorial, we will discuss how vertex and index buffers work and go through the code to make and use them.
Index and Vertex Buffers


4 - Primitive Types

We have spent most of our time in these primitive tutorials drawing triangles in one form or another. In this tutorial, we will look at the various primitive types that are available, including primitive types that allow us to draw points and lines, as well as other methods of drawing triangles. All of these different methods can be performed using the same things we learned in the previous tutorials.
Primitive Types