Rendering primitives

Now that we have our rendering framework ready, we can finally work on the more interesting stuff—actually rendering something!

All rendered objects, at their simplest form, are made up of one or more primitives: points, lines, or triangles which are made up of one or more vertices. In this recipe, we will render the following primitives:

  • A set of colored arrows representing the x, y, and z axes (red, green, and blue) using lines
  • A triangle using a triangle
  • A quad (made up of two triangles)

We will also implement our WVP matrix and see how multisampling affects the rendered image. The final result is shown in the following figure:

Rendering primitives final output

Getting ready

We'll start by creating a new Windows Form Application ...

Get Direct3D Rendering Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.