Sign in to follow this  
russell1983

[SlimDX] Draw dotted line

Recommended Posts

dave    2187
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
jpetrie    13099
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
Adam_42    3629
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
russell1983    100
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

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