Mesh.Torus Method |
Language: |
Uses a left-handed coordinate system to create a mesh that contains a torus.
Visual Basic Public Shared Function Torus( _
ByVal device As Device, _
ByVal innerRadius As Single, _
ByVal outerRadius As Single, _
ByVal sides As Integer, _
ByVal rings As Integer, _
ByRef adjacency As GraphicsStream _
) As MeshC# public static Mesh Torus(
Device device,
float innerRadius,
float outerRadius,
int sides,
int rings,
out GraphicsStream adjacency
);C++ public:
static Mesh^ Torus(
Device^ device,
float innerRadius,
float outerRadius,
int sides,
int rings,
[Out] GraphicsStream^% adjacency
);JScript public static function Torus(
device : Device,
innerRadius : float,
outerRadius : float,
sides : int,
rings : int,
adjacency : GraphicsStream
) : Mesh;
device Microsoft.DirectX.Direct3D.Device
A Device object that represents the device associated with the text mesh.innerRadius System.Single
Inner radius of the torus; should be greater than or equal to 0.0f.outerRadius System.Single
Outer radius of the torus; should be greater than or equal to 0.0f.sides System.Int32
Number of sides in a cross section; must be greater than or equal to 3.rings System.Int32
Number of rings in the torus; must be greater than or equal to 3.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 torus mesh.
The Mesh.Torus method draws a doughnut shape, 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.
The mesh that this method returns can later be used by the application for drawing or manipulation.
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.
Send comments about this topic to Microsoft. © Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center