programming4us
programming4us
MULTIMEDIA

DirectX 10 Game Programming : 3D Primer - Primitive Types

- How To Install Windows Server 2012 On VirtualBox
- How To Bypass Torrent Connection Blocking By Your ISP
- How To Install Actual Facebook App On Kindle Fire
1/12/2013 3:31:29 AM

When drawing geometry, Direct3D has the option of interpreting the points you send in multiple ways. By connecting these points in different ways, it affects how your geometry is drawn. For instance, you could declare a series of three points; depending on the primitive type you select, these points could be drawn as either three individual dots or as a line-connected triangle.

Based on the primitive type you select, the number of points necessary to draw your object can be greatly reduced.

Direct3D offers the following primitive types:

  • Point lists

  • Line lists

  • Line strips

  • Triangle lists

  • Triangle strips

  • Triangle fans

Point Lists

A point list consists of a series of points that are not connected in any way. Figure 1 shows a grid containing four distinct points. Each point is defined using X, Y, and Z coordinates. For example, the top-left point would be defined as (1, 6, 0).

Figure 1. An example of rendered points using a point list.


Line Lists

Line lists consist of lines constructed by two points, one at each end. The lines within a line list are not connected. Figure 2 shows two lines rendered using a line list. This particular line list is constructed from four vertices. The line on the left is formed using (–6, 5, 0) for the upper coordinate and (–4, 2, 0) for the bottom coordinate.

Figure 2. Lines rendered using a line list.


Line Strips

Line strips are a series of connected lines where each additional line is defined by a single vertex. Each vertex in the line strip is connected to the previous vertex for a line. Figure 3 shows how a line list is constructed and rendered. The line list in this figure is constructed using a series of six vertices creating five lines.

Figure 3. Lines rendered using a line strip.


Triangle Lists

Triangle lists contain triangles that are not connected in any way and can appear anywhere within your world. Figure 4 shows two individual triangles constructed from six vertices. Each triangle requires three vertices to construct a complete triangle.

Figure 4. Triangles rendered using a triangle list.


Triangle Strips

Triangle strips are a series of triangles connected to one another where only one vertex is required to define each additional triangle. Figure 5 shows four triangles created using only six vertices.

Figure 5. Triangles rendered using a triangle strip.


Triangle strips are constructed first by creating three vertices to define the first triangle. If an additional vertex is defined, lines are drawn between the two

previously created vertices, forming another triangle. Within Figure 5, the order in which the vertices are created is shown.

Triangle Fans

Triangle fans are a series of triangles that share a common vertex. After the first triangle is created, each additional vertex creates another triangle with one of its points being the first vertex defined.

Figure 6 shows how a triangle fan consisting of three triangles is created using only five vertices. The order of the vertices controls what the triangle fan looks like. Figure 6 shows the order in which the vertices are created to construct the displayed fan.

Figure 6. Triangles rendered using a triangle fan.

Other  
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
REVIEW
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us
programming4us
 
 
programming4us