[quote name='Yura' timestamp='1355409031' post='5010229']
Is it possible to draw rectangles, not triangles? There is not rectangles in PrimitiveType enum...
You make a rectangle from triangles, 2 triangles make one square / rectangle, unless you mean using quads?
I noticed you were using 8 points for a rectangle too, which would make sense if you were using linelist, eitherway with triangles you would only need 6 points (4 if indexed). You can always convert single points to quads (rectangles) using the geometry shader, which is probably better for what you want doing
How are you learning DirectX btw?
[/quote]
I can triangulate any 3D surface, so, as a result of triangulation I receive list of elements. Each element consists of 3-8 points, but mostly it has 4 or 8 points, because it is triangulation with quadrangular elements. You are right, I'm using line list do draw each element, so, if it has 4 points, I must put in VertexBuffer 8 points, to draw it completely. It's a bit excessive, but I don't know how to make it another way and it works nice.
[source lang="csharp"]List<Vertex> points = new List<Vertex>();
for (int i = 0; i < elements.Length; i++)
{
List<Node> list = elements.Nodes;
int listCount = list.Count;
for (int j = 0; j < listCount - 1; j++)
{
points.Add(new Vertex() { Color = SharpDX.Color.Red, Position = new Vector4(list[j].X, list[j].Y, list[j].Z, 1.0f) });
points.Add(new Vertex() { Color = SharpDX.Color.Red, Position = new Vector4(list[j + 1].X, list[j + 1].Y, list[j + 1].Z, 1.0f) });
}
points.Add(new Vertex()
{
Color = SharpDX.Color.Red,
Position = new Vector4(list[listCount - 1].X, list[listCount - 1].Y,
list[listCount - 1].Z, 1.0f) });
points.Add(new Vertex() { Color = SharpDX.Color.Red, Position = new Vector4(list[0].X, list[0].Y, list[0].Z, 1.0f) });
}[/source]
Look at this links, I'll show what I have:
this is lines http://imageshack.us/photo/my-images/194/capturerse.png/
this is triangles http://imageshack.us/photo/my-images/51/capture3be.png/
and this is what I need http://imageshack.us/photo/my-images/546/capture2pu.png/
Quads must be filled with some colour, but must have visible lines. I'm not sure it is possible to make with triangle list.
About DirectX, I'm learning it directly from the internet: forums, code examples etc. I do not read any thick books, if you asking about it)
Thanks for losing your time on me)