   X file structure problem
  Hi,I have created a heightmap of a city. Now i want to create a huge terrain. I used that map in blender to create a terrain mesh. I exported that to X file and imported it in my program. It was extremely slow so I found out about quadtrees and i am trying to implement it. The problem is that quadtrees need me to have vertices sorted but my mesh is in an X file. Now I don't know how vertices in a mesh file are organized. I checked the mesh file and there are lot of redundant vertices as well.How can I get the vertices uniquely and in order because I prefer not building a terrain from bmp straightaway cause blender makes it easy to use textures and stuff if i need to add it and lot more flexibility in general.Is there a way to do this and am I missing something obvious??Thanks   
  Ok, can some atleast tell me this; is there a way to remove duplicate vertices in a mesh. I thought mesh OptimizeInPlace would do that but the vertex count still remains the same. If i do it manually I will have to work on the indexbuffer as well. Does Optimize remove duplicate vertices or is there another way??Thanks   ;  If the mesh is in a triangle list they aren't technically redundant, well they are but....  If you want to rid yourself of them you have to index them as a strip and basically play connect the dots(format with an index buffer accordingly)!  If of course this is what you are talking about.  A specific example could help!   ;  You can try using the D3DXWeldVertices Function (I am assuming you are using DX9) to remove repeated vertices. If you want to further simplify your mesh, you can try using the D3DXSimplifyMesh function.   ;  Maybe segment the terrain in Blender. If correctly exported it should show up as a series of submeshes in the D3DXMesh which you can determine visibility for and cull separately. If you split into say 8x8 segments, you can calculate a bounding box for each segment and render this segment only if it's in view. Google for frustum tests to get an overview.   