Poncho843 Posted November 4, 2004 Posted November 4, 2004 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 Quote
Knight Chat X Posted November 20, 2004 Posted November 20, 2004 (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 November 20, 2004 by Knight Chat X Quote
ThePentiumGuy Posted November 21, 2004 Posted November 21, 2004 Wow thanks for the link! Although I wish I had code and a project file to demonstrate this.. Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.