Original Post
Hi guys, I'm getting artifacts when I'm drawring a LineStrip primitive from Vector2 Objects. I call this method 4 times from my main program: public void DrawCrack(Device device) { // get the Vector[] from the path arraylist Vector2[] vecs = (Vector2[])path.ToArray(typeof(Vector2)); // Create the VertexBuffer VertexBuffer vb = new VertexBuffer(typeof(CustomVertex.PositionNormalColored), vecs.Length, device, Usage.Dynamic | Usage.WriteOnly, CustomVertex.PositionNormalColored.Format, Pool.Default); // Fill it with vecs CustomVertex.PositionNormalColored[] verts = new CustomVertex.PositionNormalColored[vecs.Length]; int r = RandomColor.ToArgb(); for (int i = 0; i < vecs.Length; i++) { verts.X = vecs.X; verts.Y = vecs.Y; verts.Z = 0; verts.Color = r; verts.Normal = new Vector3(0, 0, -1.0f); } vb.SetData(verts, 0, LockFlags.None); // Output verticies to console (once) if (!hwal) { foreach (Vector2 v in vecs) Console.WriteLine(v.ToString()); hwal = true; } //Move back to (0,0) device.Transform.World = Matrix.Translation(0, 0, 0); device.VertexFormat = CustomVertex.PositionNormalColored.Format; device.SetStreamSource(0, vb, 0); device.DrawPrimitives(PrimitiveType.LineStrip, 0, verts.Length); vb.Dispose(); } It should produce 4 lines along their path from 0,0,0 but instead it produces this:
The full code for the program is here. I'm using Visual Studio 2005 Beta 2, DX9 October SDK using the .NET 1.1 DX library. Any help would be greatly appreciated. Steve [Edited by - sylverfyre on November 1, 2005 6:03:44 AM]