Share via


Mesh.Cylinder Method

Uses a left-handed coordinate system to create a mesh that contains a cylinder.

Namespace: Microsoft.WindowsMobile.DirectX.Direct3D
Assembly: Microsoft.WindowsMobile.DirectX (in microsoft.windowsmobile.directx.dll)

Syntax

'Declaration
Public Shared Function Cylinder ( _
    device As Device, _
    radius1 As Single, _
    radius2 As Single, _
    length As Single, _
    slices As Integer, _
    stacks As Integer _
) As Mesh
'Usage
Dim device As Device
Dim radius1 As Single
Dim radius2 As Single
Dim length As Single
Dim slices As Integer
Dim stacks As Integer
Dim returnValue As Mesh

returnValue = Mesh.Cylinder(device, radius1, radius2, length, slices, stacks)
public static Mesh Cylinder (
    Device device,
    float radius1,
    float radius2,
    float length,
    int slices,
    int stacks
)
public:
static Mesh^ Cylinder (
    Device^ device, 
    float radius1, 
    float radius2, 
    float length, 
    int slices, 
    int stacks
)
public static Mesh Cylinder (
    Device device, 
    float radius1, 
    float radius2, 
    float length, 
    int slices, 
    int stacks
)
public static function Cylinder (
    device : Device, 
    radius1 : float, 
    radius2 : float, 
    length : float, 
    slices : int, 
    stacks : int
) : Mesh
Not applicable.

Parameters

  • device
    A Device object that represents the device associated with the created cylinder mesh.
  • radius1
    Radius at the negative Z end. Value should be greater than or equal to 0.0f.
  • radius2
    Radius at the positive Z end. Value should be greater than or equal to 0.0f.
  • length
    Length of the cylinder along the z-axis.
  • slices
    Number of slices around the main axis.
  • stacks
    Number of stacks along the main axis.

Return Value

A Mesh object that represents the cylinder mesh.

Exceptions

Exception type Condition

InvalidCallException

The method call is invalid. For example, a method's parameter may contain an invalid value.

OutOfMemoryException

Direct3D could not allocate sufficient memory to complete the call.

Remarks

The created cylinder is centered at the origin, and its axis is aligned with the z-axis.

Platforms

Windows CE, Windows Mobile for Pocket PC, Windows Mobile for Smartphone

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Compact Framework

Supported in: 2.0

See Also

Reference

Mesh Class
Mesh Members
Microsoft.WindowsMobile.DirectX.Direct3D Namespace