Sign in to follow this  
stiopa

Drawing lines with rounded endings with Direct3D.

Recommended Posts

[font=Arial,][size=4]Is there any way to draw a line using ID3DXLine with round endings? I am trying to draw a curve from number of line segments, but getting the empty areas where the line segments are connecting(the lines I am drawing are pretty thick). Performance here is essential.[/size]

[size=4]Thanks![/size]

[/font]

Share this post


Link to post
Share on other sites
[quote name='stiopa' timestamp='1311282645' post='4838650']
[font="Arial,"][size="4"]Is there any way to draw a line using ID3DXLine with round endings? I am trying to draw a curve from number of line segments, but getting the empty areas where the line segments are connecting(the lines I am drawing are pretty thick). Performance here is essential.[/size]

[size="4"]Thanks![/size]

[/font]
[/quote]

Probably not the best solution but you could draw decreasingly smaller lines in the same direction but smaller thickness with longer length / height it would create a rounded effect but it would take many more calls to your line drawing.


For instance say your line is 5 spaces in width
[code]|||||
|||||[/code]
you draw another line 3 spaces in width farther than that line
[code] |||
|||||
|||||[/code]

and do the same thing with a line 1 space in length
[code] |
|||
|||||
||||| [/code]

Share this post


Link to post
Share on other sites
[quote name='stiopa' timestamp='1311313261' post='4838786']
This method would really hurt my performance, wouldn't it ?
[/quote]

Its going to effect your performance some, in my example it would take a single line draw to 3.
I have not used ID3DXLine [size="2"]personally so I can't speak for the rendering speed, I would try it and see what it does.[/size]

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