Microsoft DirectX 8.1 (Visual Basic)

D3DX8.CreateTorus

Creates an empty texture.

object.CreateTorus( _ 
    D3DDevice As Direct3DDevice8, _ 
    InnerRadius As Single, _ 
    OuterRadius As Single, _ 
    Sides As Long, _ 
    Rings As Long, _ 
    RetAdjacency As D3DXBuffer) As D3DXMesh

Parts

object
Object expression that resolves to a D3DX8 object.
D3DDevice
Direct3DDevice8 object representing the device to be associated with the texture.
InnerRadius
Inner-radius of the torus. Value should be greater than or equal to 0.
OuterRadius
Outer-radius of the torus. Value should be greater than or equal to 0.
Sides
Number of sides in a cross-section. Value must be greater than or equal to 3.
Rings
Number of rings making up the torus. 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 torus.

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 CreateTorus method draws a doughnut, centered at (0, 0, 0) whose axis is aligned with the z-axis. The inner-radius of the torus is the radius of the cross-section (the minor-radius), and the outer-radius of the torus is the radius of the central hole.

This method returns a mesh that can be used later for drawing or manipulation by the application.