Microsoft DirectX 8.1 (Visual Basic)

D3DX8.CreatePolygon

Uses a left-handed coordinate system to create a mesh containing an n-sided polygon.

object.CreatePolygon( _ 
    D3DDevice As Direct3DDevice8, _ 
    Length As Single, _ 
    Sides As Long, _ 
    RetAdjacency As D3DXBuffer) As D3DXMesh

Parts

object
Object expression that resolves to a D3DX8 object.
D3DDevice
Direct3DDevice8 object, representing the device associated with the created polygon mesh.
Length
Length of each side
Sides
Number of sides for the polygon. Value must be greater than or equal to 3.
RetAdjacency
D3DXBuffer object. When the method returns, this parameter is filled with an array of three Long values per face that specify the three neighbors for each face in the mesh.

Return Values

D3DXMesh object, representing the created polygon mesh.

Error Codes

If the method fails, an error is raised and Err.Number can be set to one of the following values.

D3DERR_INVALIDCALL
D3DXERR_INVALIDDATA
E_OUTOFMEMORY

For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.

Remarks

The created polygon is centered at the origin.