Mesh.FromX Method |
Language: |
Loads a mesh from an XFileData object.
Visual Basic Public Shared Function FromX( _
ByVal xofObjMesh As XFileData, _
ByVal options As MeshFlags, _
ByVal device As Device _
) As MeshC# public static Mesh FromX(
XFileData xofObjMesh,
MeshFlags options,
Device device
);C++ public:
static Mesh^ FromX(
XFileData^ xofObjMesh,
MeshFlags options,
Device^ device
);JScript public static function FromX(
xofObjMesh : XFileData,
options : MeshFlags,
device : Device
) : Mesh;
xofObjMesh Microsoft.DirectX.Direct3D.XFileData
An XFileData object that contains the mesh data.options Microsoft.DirectX.Direct3D.MeshFlags
One or more flags from the Mesh enumeration that specify creation options for the mesh (excepting Simplify* and Optimize* flags).device Microsoft.DirectX.Direct3D.Device
The Deviceto associate with the mesh.
Microsoft.DirectX.Direct3D.Mesh
A Mesh object that represents the loaded mesh.
All meshes in the file are collapsed into one output mesh. If the file contains a frame hierarchy, all of the transformations are applied to the mesh.
For mesh files that do not contain effect instance information, default effect instances are generated from the material information in the DirectX (.x) file. A default effect instance has default values that correspond to the members of the Material structure.
The default texture name also is filled in, but is handled differently. The name is Texture0@Name, which corresponds to an effect variable by the name of "Texture0" with an annotation called "Name." This variable contains the string file name for the texture.
Exceptions
InvalidCallException The method call is invalid. For example, a method's parameter might contain an invalid value. 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