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:
Getting ready
We'll start by creating a new Windows Form Application project named Ch02_01RenderingPrimitives
in the D3DRendering.sln
solution:
Add the
SharpDX.dll
,SharpDX.DXGI.dll
andSharpDX.Direct3D11.dll
references like we did in the previous recipes.Next, we will add a reference to
.\External\bin\SharpDX.D3DCompiler...