Public Sub LoadMesh(ByVal FileName As String, ByVal TextureFileName As String)
Dim intX As Integer
objMesh = Mesh.FromFile(FileName, MeshFlags.SystemMemory, d3ddev, extMaterials)
ReDim MeshTexture(extMaterials.Length)
ReDim Mat(extMaterials.Length)
For intX = 0 To extMaterials.Length - 1
Mat(intX) = extMaterials(intX).Material3D
Mat(intX).Ambient = Mat(intX).Diffuse
extMaterials(intX).TextureFilename = TextureFileName
MeshTexture(intX) = TextureLoader.FromFile(d3ddev, extMaterials(intX).TextureFilename)
Next
End Sub