Mesh Viewer

Posted on 2003-03-13
Medium Priority
Last Modified: 2013-12-08
Is there a site from which I can download src files of an application for loading and displaying *.x
files ?
Question by:popeye_luck
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

fzr253 earned 100 total points
ID: 8238137
There's one in the DirectX SDK...

SDKpath\bin\DXUtils\Mesh Viewer

D/L the SDK here:

Assisted Solution

zimo earned 100 total points
ID: 8239642
If you need sample program for reading X file by DX
you can use from DirectX SDK

it is similar as MeshViewer

A few moths ago there was ActiveX applet for reading X files on Microsoft page, but it was removed.


Assisted Solution

RageDBL earned 100 total points
ID: 8314684
Here's the function definition off of http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_m/directx/ref/ns/microsoft.directx.direct3d/c/mesh/m/fromfile0.asp


(for Managed C++)

public: static Mesh* FromFile(
    String* filename,
    MeshFlags options,
    Device* device,
    EffectInstance* effects


filename System.String.  
options Microsoft.DirectX.Direct3D.MeshFlags.  
device Microsoft.DirectX.Direct3D.Device.  
effects Microsoft.DirectX.Direct3D.EffectInstance.  

Return Value



I think all the Microsoft.DirectX.Direct3D.Mesh can be substituted with LPDIRECT3DXMESH or something to that effect.

As for viewing the mesh, just use the mesh's DrawSubset() method between (YOUR D3DDEVICE)->BeginScene() and (YOUR D3DDEVICE)->EndScene().



I'm not sure what SUBSETNUMBER is used for, but it probably has to do with different parts of the mesh. I usually use 0 when rendering things like a sphere. You may have to look into this.
Also, I think you may have to set the material for the device for the mesh, but this may not be necessary. As for textures, you do the same thing, if it has a texture at all. I think that the parts that have different textures may be sorted into the subsets. In that case you would have to set the texture from it as well.

You should really look into Microsoft's tutorial at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_m/directx/direct3d/tutorials/tutorial6.asp . You just have to change a few of the types mentioned (such as Microsoft.DirectX.Direct3D.Mesh to LPDIRECT3DMESH (or I think in DX8 it's LPDIRECT3DMESH8).

Hope this helps,


Expert Comment

ID: 9464659
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As game developers, we quickly learn that Artificial Intelligence (AI) doesn’t need to be so tough.  To reference Space Ghost: “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer. (http://www.youtu…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question