Smooth out an edge of a line

Started by
2 comments, last by Bob Janova 18 years ago
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.
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.

I know only that which I know, but I do not know what I know.
Overlay the quads with circles (whose diameter is the width of the quads) at each point.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
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.

This topic is closed to new replies.

Advertisement