Jump to content
  • Advertisement
Sign in to follow this  
russell1983

[SlimDX] Draw dotted line

This topic is 3030 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

Advertisement
The only way i know of is to draw line lists using the standard Draw*Primitive() calls. You'd have to work your the spacing yourself ofcourse.

Share this post


Link to post
Share on other sites
There are plenty of papers floating around the internet on rendering thick lines (look for things like 'contour edges,' 'silhouette edge rendering,' 'thick,' 'textured' or 'stroked' line rendering, et cetera). You can then implement one of the algorithms described therein -- the textured line implementations will likely give you the easiest means of creating a dot or stipple pattern in the line.

Share this post


Link to post
Share on other sites
You should also be able to set a texture (and shader if you need it) on a standard line primitive, which will get you a dashed effect with an appropriate texture and UV coordinates. You'll probably want to wrap a texture along the length of the line, and set the UVs based on the line length so the dashes don't scale with line length.

Share this post


Link to post
Share on other sites
Thanks for answers. I use D3D9 and I want to use class SlimDX.Direct3D9.Line. When I use MDX to draw dotted line I use following pattern - 0x88888888. This pattern
is uint type. But member Pattern(class Line) is int type. When I cast 0x88888888 to int type it does not draw dotten line. How can I solve this problem?

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!