Jump to content
  • Advertisement
Sign in to follow this  
Ectara

OpenGL Drawing thick arcs in 2D

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

I've been having some difficulty rendering a Bezier curve for use in font vectorization. When I render an arc, I interpolate the curve(In this case, cubic), in steps of 1/64 or 1/256, and draw lines of a specified thickness between the calculated points. I draw the lines as OpenGL specified in its line width documentation; if x2 - x1 >= y2 - y2, draw 'width' columns of pixels, else draw 'width' rows of pixels per point on the line. Consider this image, where red points draw their width vertically, and green points draw their width horizontally. Note the gap, where the colors change. Is there a method to draw thick curves that would also work for lines, such as in a curve where all points are colinear? If I draw the width both horizontally and vertically, a straight line would end in crosses. Does anyone have a suggestion or a solution?

Share this post


Link to post
Share on other sites
Advertisement
Solved, more or less. To resolve this issue, one must miter the endpoints of the line, or draw a shape over the endpoints, usually a circle.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!