?
Solved

Mesh Viewer

Posted on 2003-03-13
5
Medium Priority
?
1,209 Views
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 ?
0
Comment
Question by:popeye_luck
4 Comments
 
LVL 1

Accepted Solution

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

SDKpath\bin\DXUtils\Mesh Viewer

D/L the SDK here:
http://msdn.microsoft.com/library/default.asp?url=/downloads/list/directx.asp
0
 

Assisted Solution

by:zimo
zimo earned 100 total points
ID: 8239642
If you need sample program for reading X file by DX
you can use from DirectX SDK
\Samples\C++\Direct3D\Meshes\SkinnedMesh

it is similar as MeshViewer

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

regards
ZiMo
0
 
LVL 1

Assisted Solution

by:RageDBL
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
);

Parameters

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

Return Value

Microsoft.DirectX.Direct3D.Mesh

<

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().

EXAMPLE>

(YOUR MESH)->DrawSubset(<SUBSETNUMBER>);

<
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,

RageDBL
0
 

Expert Comment

by:CleanupPing
ID: 9464659
popeye_luck:
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 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

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

Artificial Intelligence comes in many forms, and for game developers, Path-Finding is an important ability for making an NPC (Non-Playable Character) maneuver through terrain.  A* is a particularly easy way to approach it.  I’ll start with the algor…
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…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
This video tutorial shows you the steps to go through to set up what I believe to be the best email app on the android platform to read Exchange mail.  Get the app on your phone: The first step is to make sure you have the Samsung Email app on your …
Suggested Courses
Course of the Month9 days, left to enroll

621 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