Hi All,
I've been scratching my head on this one for a little and I'm really just after some guidance.
I've searched google and the forums and can't find an answer, or at least one I understand. I'm trying to stroke an array of vertices. Basically, exactly like how you stroke a path in Photoshop with a Brush.
I understand that SFML can't do this out of the box.
My use case is I have a berzier curve function which I use to calculate the coords of say 10 points along the curve. I'm then adding these points to a Vertex Array as a Line Array. I'd now like to drawn a nice thick 6 pixel line (brush) along this path.
I've sort of come to the conclusion that I'd need to do this using a Polygon. So I thought if I calculate the direction vector at each point, I could then calculate the point that's at a right angle direction to either side of my original point at a distance of half the stroke width. Then I would be able to add each of these points to a Vertex Array working along the two points that are 90 degrees from the first point, 90 degress from the second point and then at the last point I can work my way back down along the 270 degree angle points.
Then I can just fill the resulting polygon that's the width I want, and centered directly on the top of my original Vertex array.
I would like to get some validation on this before I go to all the effort of learning the necessary vector math. Is there a better way to do this? Has someone already gone to the effort to code it up for me?