![]() |
![]() |
![]() |
Mesh.Sphere Method |
Language: |
Uses a left-handed coordinate system to create a mesh that contains a sphere.
Visual Basic .NET Public Shared Function Sphere( _
ByVal device As Device, _
ByVal radius As Single, _
ByVal slices As Integer, _
ByVal stacks As Integer, _
ByRef adjacency As GraphicsStream _
) As MeshC# public static Mesh Sphere(
Device device,
float radius,
int slices,
int stacks,
out GraphicsStream adjacency
);Managed C++ public: static Mesh* Sphere(
Device *device,
float radius,
int slices,
int stacks,
GraphicsStream **adjacency
);JScript .NET public static function Sphere(
device : Device,
radius : float,
slices : int,
stacks : int,
adjacency : GraphicsStream
) : Mesh;
device Microsoft.DirectX.Direct3D.Device. A Device object that represents the device associated with the created sphere mesh. radius System.Single. Radius of the sphere. This value should be greater than or equal to 0.0f. slices System.Int32. Number of slices around the main axis. stacks System.Int32. Number of stacks along the main axis. adjacency Microsoft.DirectX.GraphicsStream. A GraphicsStream object containing an array of three Int32 values per face that specify the three neighbors for each face in the mesh.
Microsoft.DirectX.Direct3D.Mesh . A Mesh object that represents the sphere mesh.
The created sphere is centered at the origin, and its axis is aligned with the z-axis.
Exceptions
InvalidCallException The method call is invalid. For example, a method's parameter might contain an invalid value. InvalidDataException The data is invalid. OutOfMemoryException Microsoft® Direct3D® could not allocate sufficient memory to complete the call.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center