Jump to content
  • Advertisement
Sign in to follow this  
tanel1993

How to display vertices?

This topic is 3118 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
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.

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!