DXViewer

Started by
3 comments, last by tholland 14 years, 1 month ago
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
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.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

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

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

Thanks again. I have recovered MView from one of my earlier SADKs (August 2005). Now for the source code and my app!

This topic is closed to new replies.

Advertisement