How to display vertices?

Started by
3 comments, last by unbird 14 years, 1 month ago
In managed directx, how can i make the vertices display as little points? Also i would like to know how to make them display in different colors. I haven't tried much anything, thought of a rectangle for each vertex, but i don't really know how to use them.
Advertisement
I believe there was something like
pd3dDevice->DrawPrimitive(D3DPT_POINTLIST...) ;
in the FFP.

If you want your points to have different colors, your vertex struct/buffer must provide it. In MDX use device.VertexFormat with a VertexFormats.Diffuse.

If you want to do more than just simple dots (single pixels) you can use so called point sprites (search the corresponding article in the Direct X docs). You enable it with
device.RenderState.PointSpriteEnable = true;

With an arbitrary texture you can pretty much draw what you want, not only rectangles:
device.SetTexture(0, myPointSpriteTexture);


My code examples are in C#. What language do you use ?

Hope that helps.

[Edited by - unbird on March 7, 2010 6:48:51 PM]
I also use C# and i don't just want points to draw, i want them to stand out on the wireframe model. Just like in a model creating program.
What do you mean by that ? 2D or 3D "points" ?

For 2D you could still use points sprites.

For 3D you would have to resort to actually draw a complete mesh for every vertex (at that position), for instance a sphere or a box.

This topic is closed to new replies.

Advertisement