DirectX .X files with VB.net

I have a VB.net app in Visual Studio 2008 that I need to add a small amount of 3D graphics to.  I have the newest Directx SDK.  I am familiar with VB but new to Directx.

I am able to make shapes and graphics from within the app by defining vertices etc, but these are just simple shapes.  What I would like to do is import the .X files I have made from 3DS Max into my VB app.  

I have seen references online to a D3DXLoadMeshFromX method, but I do not see it anywhere in the Directx SDK, and all examples I see attempting to use this method are in C++.  Could I get some help on how to use my .X file in my VB app?! Thanks.



andyfettAsked:
Who is Participating?
 
ikeworkConnect With a Mentor Commented:
oh sorry your right. the Mesh-class has a static member-method called FromFile

Mesh m = Mesh.FromFile( "file.x" ...

here is the doc:

http://msdn.microsoft.com/archive/en-us/directx9_m_Oct_2004/directx/ref/ns/microsoft.directx.direct3d/c/mesh/m/fromfile.asp?frame=true
0
 
ikeworkCommented:
hi andyfett

here is an example:

http://www.gamedev.net/reference/articles/article1606.asp


ike
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
andyfettAuthor Commented:
Actually both of those links are for Directx 8 and it looks like VB6...

I notice they use the  LoadMeshFromX() method, which looks like what i'd want,  but I don't see that anywhere in the new SDK...
0
 
andyfettAuthor Commented:
I have attached a sample .X file here.  I would love to see how this is loaded into a VB.net DirectX9 app if possible.  Thanks.
Torus.txt
0
 
ikeworkCommented:
0
 
andyfettAuthor Commented:
Thanks ikework, mesh.fromfile() is exactly what I was looking for and got me on the right track.

Another good example is the "progressive meshes" example at http://www.codesampler.com/usersrc/usersrc_3.htm

p.s. your last example was C# not VB :)

0
All Courses

From novice to tech pro — start learning today.