Sign in to follow this  
tanel1993

How to display vertices?

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this