Smooth out an edge of a line
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.
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.
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
Popular Topics
Advertisement