Sign in to follow this  
webjeff

Smooth out an edge of a line

Recommended Posts

webjeff    241
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
Daishim    244
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
Bob Janova    769
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

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