Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Mesh.Sphere Method

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

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

public static Mesh Sphere(
	Device device,
	float radius,
	int slices,
	int stacks
)

Parameters

device
Type: Microsoft.WindowsMobile.DirectX.Direct3D.Device

A Device object that represents the device associated with the created sphere mesh.

radius
Type: System.Single

Radius of the sphere. This value should be greater than or equal to 0.0f.

slices
Type: System.Int32

Number of slices around the main axis.

stacks
Type: System.Int32

Number of stacks along the main axis.

Return Value

Type: Microsoft.WindowsMobile.DirectX.Direct3D.Mesh
A Mesh object that represents the sphere mesh.

ExceptionCondition
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.

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

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

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Compact Framework

Supported in: 3.5, 2.0

Community Additions

ADD
Show:
© 2015 Microsoft