   grid rendering methods
  lo, does anyone have suggestions on the best way to render a grid? (like in an editor such as milkshape/3ds max/etc)   
  All I do is just iterate over the grid and setup a bunch of line segments, it's very easy.  If you don't have your own line rendering mechanisms in-place, you could always use ID3DXLine instead.If you want to use ID3DXLine, you can either transform the vertices into screen-space manually and draw them with ID3DXLine::Draw().  However, it would be really easy to just use ID3DXLine::DrawTransform(), where you can specify vertices in world space.   ; Vector2[] tLineArray = new Vector2[4]; tLineArray[0] = new Vector2(0.0f,50f); tLineArray[1] = new Vector2(640.0f, 50.0f); tLineArray[2] = new Vector2(0.0f, 100f); tLineArray[3] = new Vector2(640.0f, 100.0f); Line tline = new Line(Editor_Device); tline.Antialias = true; tline.Begin(); tline.Draw(tLineArray,System.Drawing.Color.SlateBlue.ToArgb()); tline.End();using the above it works , but the lines are "joined" like a linestrip is there anyway to stop this and have it like a linelist?[Edited by - Bytez on May 15, 2006 1:10:27 AM];Quote:Original post by Bytezusing the above it works , but the lines are "joined" like a linkstrip is there anyway to stop this and have it like a linelist?Ah crap, I forgot about that, sorry.  For some reason, ID3DXLine only uses linestrips (ie one continuous line).  Some things you can do:(1) Code your own line renderer that uses line lists.  All you need to do is make a VB, lock it, fill it with your line vertices, and draw.(2) Only call ID3DXLine::Draw*() with 2 vertices at a time.  Essentially what you are doing is forcing it to use line lists.  However, I am not sure about the internals of ID3DXLine, so this could be very slow.  On the other hand, there could be no noticable speed decrease.   ;  I found the easiest way is to create a vertex buffer and fill it with pairs of vertices, where each pair gives the start and end point for each line.  Then use the following to draw them:pDevice->DrawPrimitive(D3DPT_LINELIST, 0, mTotLines);;  thanks alot:D   ;  Draw some quads across the x/z and set the fill mode to wireframe.   ;Quote:Original post by BornToCodeDraw some quads across the x/z and set the fill mode to wireframe.Won't work in this case - Direct3D has no knowledge of a "quad" and will see it as two triangles. You'll end up with diagonal grid lines as well as the horizontal/vertical ones the OP wants [smile]hthJack   