Microsoft DirectX 8.1 (Visual Basic)

D3DX8.CreateSphere

Uses a left-handed coordinate system to create a mesh containing a sphere.

object.CreateSphere( _ 
    D3DDevice As Direct3DDevice8, _ 
    Radius As Single, _ 
    Slices As Long, _ 
    Stacks As Long, _ 
    RetAdjacency As D3DXBuffer) As D3DXMesh

Parts

object
Object expression that resolves to a D3DX8 object.
D3DDevice
Direct3DDevice8 object, associated with the created sphere mesh.
Radius
Radius of the sphere. This value should be greater than or equal to 0.
Slices
Number of slices about the main axis.
Stacks
Number of stacks along the main axis.
RetAdjacency
D3DXBuffer object to be 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 sphere.

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 sphere is centered at the origin, and its axis is aligned with the z-axis.