Sign in to follow this  
fguihen

mesh wont fully display in dx9

Recommended Posts

i put this in the DX forum, but im prob better suited to this forum so il post here also , if the admins dont mind. my prob is that i have taken a charachter from poser into 3DS max , and using panda, i exported the file as a .x file. now when i view the mesh in my application( written in c#, if it matters) , i only see part of the charachter. i can see his legs, but none of his upper torso except bits of his shoulders. i tried messing with panda settings to flip normals and stuff, but with no avail. its not the lighting, as the parts that show up show up fine, in color but i cant see why the rest of him is gone. any help would be greatly appriciated. thanks all. here is the code for displaying and loading the mesh:
private void LoadMesh(string file)
		{
			ExtendedMaterial [] mtrl;
			mesh = Mesh.FromFile(file,MeshFlags.Managed,device,out mtrl);

			if((mtrl != null) && (mtrl.Length > 0))
			{
				meshMaterials = new Material[mtrl.Length];
				meshTextures = new Texture[mtrl.Length];

				//store each material and texture
				for(int i = 0; i < mtrl.Length ; i++)
				{
					meshMaterials[i] = mtrl[i].Material3D;

					if((mtrl[i].TextureFilename != null)&&(mtrl[i].TextureFilename != string.Empty))
					{
						meshTextures[i] = TextureLoader.FromFile(device,@"F:\project research\Begining Meshes\Meshes\" +mtrl[i].TextureFilename);
					}
				}
			}
		}





public void DrawMesh(float x)
		{
			//device.Transform.World = Matrix.Translation(0,0,0)*Matrix.Scaling(1,1,1) ;
			device.Transform.World = Matrix.Translation(angle,0,-angle);
			for (int i = 0; i < meshMaterials.Length;i++)
			{
				device.Material = meshMaterials[i];
				device.SetTexture(0,meshTextures[i]);
				mesh.DrawSubset(i);
			}

			if( x >=100)
			{
				device.Transform.World = Matrix.Translation(-50,0,0);
				x = 0;
				angle = 0;
			}
		}

[Edited by - fguihen on November 23, 2004 2:53:37 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by fguihen
i put this in the DX forum, but im prob better suited to this forum so il post here also , if the admins dont mind.
Sorry, we mind. Besides, it's not appropriate for this forum.

Sometimes people regard themselves as beginners but aren't. Look, you've graduated! [smile]

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this