Share via


Line Lists

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

A line list is a list of isolated, straight line segments. Line lists are useful for such tasks as adding sleet or heavy rain to a 3-D scene. Applications create a line list by filling an array of vertices, and the number of vertices in a line list must be an even number greater than or equal to two.

The following illustration shows a rendered line list.

Aa915232.94823c89-6b40-40f0-aeed-b756af6a4c72(en-us,MSDN.10).gif

The line list primitive is identified by the D3DMPT_LINELIST element of the D3DMPRIMITIVETYPE enumeration.

You can apply materials and textures to a line list. The colors in the material or texture appear only along the lines drawn, not at any point in between the lines.

The following code shows how to create vertices for this line list.

struct CUSTOMVERTEX
{
    float x,y,z;
};

CUSTOMVERTEX Vertices[] = 
{
    {-5.0, -5.0, 0.0},
    { 0.0,  5.0, 0.0},
    { 5.0, -5.0, 0.0},
    {10.0,  5.0, 0.0},
    {15.0, -5.0, 0.0},
    {20.0,  5.0, 0.0}
};

The code example below shows how to use IDirect3DMobileDevice::DrawPrimitive to render this line list:

//
// It is assumed that d3dmDevice is a valid
// pointer to a IDirect3DMobileDevice interface.
//
d3dmDevice->DrawPrimitive( D3DMPT_LINELIST, 0, 3 );

See Also

Concepts

Device-Supported Primitive Types