Jump to content
  • Advertisement
Sign in to follow this  
tholland

DXViewer

This topic is 3049 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have an x file of a triangle with a different colour in each of its three vertices. I can run this with DXViewer, but the colours don't show up, just the grey background material. The x file is as follows: xof 0303txt 0032 template VertexDuplicationIndices { <b8d65549-d7c9-4995-89cf-53a9a8b031e3> DWORD nIndices; DWORD nOriginalVertices; array DWORD indices[nIndices]; } template XSkinMeshHeader { <3cf169ce-ff7c-44ab-93c0-f78f62d172e2> WORD nMaxSkinWeightsPerVertex; WORD nMaxSkinWeightsPerFace; WORD nBones; } template SkinWeights { <6f0d123b-bad2-4167-a0d0-80224f25fabb> STRING transformNodeName; DWORD nWeights; array DWORD vertexIndices[nWeights]; array float weights[nWeights]; Matrix4x4 matrixOffset; } Frame RootFrame { FrameTransformMatrix { 1.000000,0.000000,0.000000,0.000000, 0.000000,1.000000,0.000000,0.000000, 0.000000,0.000000,1.000000,0.000000, 0.000000,0.000000,0.000000,1.000000;; } Frame Plane { FrameTransformMatrix { 1.000000,0.000000,0.000000,0.000000, 0.000000,1.000000,0.000000,0.000000, 0.000000,0.000000,1.000000,0.000000, 0.000000,0.000000,0.000000,1.000000;; } Mesh { //Plane 3; 1.000000; 1.000000; 0.000000;, 1.000000; -1.000000; 0.000000;, -1.000000; -1.000000; 0.000000;; 1; 3; 0, 1, 2;; MeshMaterialList { 1; 1; 0; Material Material001 { 0.800000; 0.800000; 0.800000; 1.0;; 0.500000; 1.000000; 1.000000; 1.000000;; 0.0; 0.0; 0.0;; } //End of Material } //End of MeshMaterialList MeshNormals { 3; 0.000000; 0.000000; -1.000000;, 0.000000; 0.000000; -1.000000;, 0.000000; 0.000000; -1.000000;; 1; 3; 0, 1, 2;; } //End of MeshNormals MeshVertexColors { 3; 0; 1.0; 0.0; 0.0; 1.0;, 1; 0.0; 1.0; 0.0; 1.0;, 2; 0.0; 0.0; 1.0; 1.0;; } //End of MeshVertexColors } // End of Mesh } // End of the Object Plane } // End of the Root Frame I have tried running this without the material templates, without the vetexcolors template and without all those templates, each version generates the grey triangle. Can anyone suggest what I'm doing wrong and how to put it right? I am using Vista Home Premium with SP2 and DX9.0b Best wishes Tony Holland

Share this post


Link to post
Share on other sites
Advertisement
The file appears fine. It displays okay for me, both in MView and my own app. I'm using WinXP and dx9, by the way.

You can try it in your own app (if you have one set up). Load the mesh material and set the device material when you render it.

Turn off lighting (in case the light direction and colors are wrong), set the device texture to NULL, set the device material and see if it renders.

// this works
if( testMesh )
{
m_pDevice->SetRenderState( D3DRS_LIGHTING,FALSE );
m_pDevice->SetMaterial(&testMeshMats[0].MatD3D);
testMesh->DrawSubset(0);
}


If not, post the code for loading the mesh and the code for your rendering loop. You likely have some device parameter setup incorrectly.

EDIT: I don't normally use DxViewer but tried DxViewer and I get just the gray triangle also. Something's not setup in the viewer. Apparently it needs an fx file loaded, also, or it just displays the geometry.

Share this post


Link to post
Share on other sites
Thanks Buckeye; I'm relieved the x file is OK (I'm trying to generate something similar using Blender and at least I now know what the output should look like!)

Is MView still available, or are you using the mobile version?

Best wishes

tholland

Share this post


Link to post
Share on other sites
Quote:
Is MView still available?

I think the Feb 2005 SDK was the last for MView (instead of DxViewer), but it looks like it can still be downloaded. In addition, the source code is available for MView.

Share this post


Link to post
Share on other sites
Thanks again. I have recovered MView from one of my earlier SADKs (August 2005). Now for the source code and my app!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!