Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello there, was wondering if anyone could help me. I have some knowledge of DX8 in VB6, recently upgraded to VB.NET so got myself DX9 summer 2004 release. I am trying to load in skinned meshes from .x files, but the docs are useless and the few examples i find on the net don't work. For example, all say to use "dataFile = dxFile.GetNextDataObject()", but then i get the error "'GetNextDataObject' is not a member of 'Microsoft.DirectX.Direct3D.XFile'". Does anybody have any examples of code i could use to load .x files in, know any websites with working examples, or could fix some code with me??? Source code i've downloaded and trying to make can be found at http://robydx.altervista.org/DirectX9/Direct3D9Less34.htm

 

Thanks in advance

 

Steve

  • 3 weeks later...
Posted (edited)

Hello There,

I don't know what you are using to create the meshes but if you're using a program such as Maya or Poser then the you have to assign a material specific to isolated portions of whatever object you wish to have a texture, that would be done for each texture you wish to be linked to the mesh object, then you export the object as an .x file, optionally you can use code or the MeshViewer to optimize a mesh or create a simple mesh primitive.

 

You load the mesh like so:

objMesh = objMesh.FromFile(Application.StartupPath & "\box.x", MeshFlags.SystemMemory, device, MeshExtendedMaterials)

 

Create a material array based on the size of MeshExtendedMaterials, create and store default materials in the array, do the same for all textures associated with the mesh object.

 

Use an index to properly place each material and texture on the object.

 

If you're planning on loading an animated mesh where all of the frames and information is in a single .x file then try checking out this link:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndrive/html/directx11192002.asp

 

:D

Edited by Knight Chat X

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...