I have a simple triangular shape (that serves as a balloon tail) which I'm trying to curve like the following:
I have the tail shape stored in a CGMutablePathRef
and it's drawn as follows:
- (void) drawPaths
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextAddPath(context, self.mutablePath);
CGPathRelease(mutablePath);
CGColorRelease(fillColor);
CGColorRelease(strokeColor);
}
I am trying to make it so when I input some angle to this algorithm (say 45 degrees) that the tail rotates and curves much like the above photo. The rotation is obviously an easy transformation, but getting it to curve is what I'm struggling with. I realize that I probably need to use: CGPathAddQuadCurveToPoint
however I'm having trouble understanding what to set as my control points and am getting unpredictable results. Even this brilliant post has left me clueless: Given a CGPath, how to make it curve?
Does anyone know how to do this?