Jump to content
  • Advertisement
Sign in to follow this  
webjeff

Smooth out an edge of a line

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

Guys: I'm trying to make a line out of points. Example: Given the points (x,y) = (0,0), (10,0), (20,10) I can construct a line with a specified width (by generating the quads) through those points. However, I want to create a rounded edge going from point (10,0) to (20,0)... my hard quad is (10,5) & (10,-5) to (20,15) & (20,5) [I'm going +5,-5 on the Y to give me a quad] But thats a hard edge at from 0,0 to 20,10 going through the point 10,0, I want to somehow generate the points in a curve from that edge. Does anyone know how this can be done? Let me know if you need a better explanation. Jeff.

Share this post


Link to post
Share on other sites
Advertisement
Using the four vertices of your quad, you could determine the equation of a circle that contains those four points, and just use the equation to generate pixel positions between two of those vertices.

Share this post


Link to post
Share on other sites
Do you want to make a smooth curve which passes through N points? In which case a cubic Bézier spline is probably what you're after. If you're just trying to draw a polygon with nice-looking joins at the corners, use PostScript and setlinejoin :P ... or in fact GDI+, which has a Pen.LineJoin property.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!