   DrawIndexedPrimitives and Mesh.DrawSubset()
  hi all;i, new here.in my code use device.DrawIndexedPrimitives(PrimitiveType.TriangleList,...) for rendering a model, it's work well but when i create a mesh with same VB and IB, and draw the mesh it is not as same as DrawIndexedPrimitives with PrimitiveType.TriangleList !!!!!!difference between this two render is when Mesh render a lots of lines start from one point.according to http://msdn.microsoft.com/en-us/library/bb297113%28v=VS.85%29.aspx DrawSubset using DrawIndexedPrimitives and TriangleList for rendering.help me plz.   
  any one know how to solve this problem??????   ;  Which version of DirectX are you using?Can you post some of your code?   ;  with MDX 2//================//=======Create VB ID & Meshvar vr = new List<CustomVertex.PositionNormalTextured>();CreateVB(vr);_vbBuffer=new VertexBuffer(typeof(CustomVertex.PositionNormalTextured), vr.ToArray().Length,device,Usage.WriteOnly, CustomVertex.PositionNormalTextured.Format,Pool.SystemMemory);_vbBuffer.SetData(vr.ToArray(), 0, LockFlags.None);_vbBuffer.Unlock();var _ind = new List&lt;int&gt;();CreateIB(_ind);_indexBuffer=new IndexBuffer( typeof(int), _ind.Count,device ,Usage.WriteOnly, Pool.SystemMemory);_indexBuffer.SetData(_ind.ToArray(),0,LockFlags.None);_indexBuffer.Unlock();MeshX = new Mesh(_ind.Count * 3, vr.Count, MeshFlags.SystemMemory, CustomVertex.PositionNormalTextured.Format, device);attributeRange.AttributeId = 0;attributeRange.FaceStart = 0;attributeRange.FaceCount = ints.Length/3;attributeRange.VertexStart = 0;attributeRange.VertexStart = vr.Count;MeshX.SetAttributeTable(new[] { attributeRange });MeshX.VertexBuffer.SetData(vr.ToArray(), 0, LockFlags.None);MeshX.VertexBuffer.PreLoad();MeshX.IndexBuffer.SetData(_ind.ToArray(), 0, LockFlags.None);MeshX.IndexBuffer.PreLoad();//============Renderdevice.SetTexture(0, _texture);device.VertexFormat = CustomVertex.PositionNormalTextured.Format; device.SetStreamSource(0, _vbBuffer, 0, CustomVertex.PositionNormalTextured.StrideSize);device.SetTransform(TransformType.World, MatWorld);device.Indices = _indexBuffer;//work well device.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, _max - _min + 1, 0,_ind.ToArray().Length/3);//not work wellMeshX.DrawSubset(0); [Edited by - hossainiir on May 24, 2010 2:29:15 PM];  Im not familiar with MDX 2 but try to set the device primitive topology.In DirectX 10 before drawing I must use this: d3dDevice->IASetPrimitiveTopology(D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST);Maybe you have to do this as well.By the way: use [source lang="cpp".] (your code here) [/source.] or [code.] [/code.] tags (when is just a line of code), when you post source code... WITHOUT DOTS BEFORE THE BRACKET ;  tnx,but this is DX10 code, i'm using DX9 and C#!   ;  i understand that  MeshX.IndexBuffer isn't set properly , and _indexBuffer is set properly!the problem is that MeshX.IndexBuffer is read only, how can i set MeshX.IndexBuffer set to _indexBuffer directly???   ;  Assuming that you are using LPD3DXMESH:LPDIRECT3DINDEXBUFFER pIndexBuffer;if (SUCCEEDED(pMesh->GetIndexBuffer(&pIndBuf))) {    WORD pIndices;    DWORD numFaces=pMesh->GetFaces();    if (SUCCEEDED(pIndexBuffer->Lock(0,numFaces*3*sizeof(WORD),(BYTE **) &pIndices,D3DLOCK_DISCARD) {   for (int i=0;i<numFaces;i++) {  for (int j=0;j<3;j++) { //set indices here *pIndices=... pIndices++;  }   }   pIndexBuffer->Unlock();    }    pIndexBuffer->Release();}Im not sure if this will work by try it   ;  Tanks Aqua Costa,i try it but does not work.   