java - Drawing a curved shape that bends along a curved trajectory -


so, wish able draw, example, raindrop in slow-motion falls top of screen. it's trajectory changes straight down , instead follows quadratic curve towards left. tricky bit raindrop's shape bends in direction follow curve. image below demonstrates intended effect want achieve programmatically.

photoshopped raindrop following curve in trajectory

if want specific coordinates, let's path begins @ 0,0 travels 0,50, curves -15,100 control point @ 0,70. typical raindrop shape can achieved through 2 mirrored bezier curves demonstrated in image below.

raindrop approximated using 2 mirrored bezier curves

i know there's way derive points along curve, means can derive start , end points of raindrop along it's curved path, don't know control points. if derive angle of end-point's trajectory, might find answer rotating control points relative that; i'm not sure enough. next step in problem happens when raindrop passes through several small curves in trajectory. can't summarised single bezier curve per side can they? (not java kind @ least, unless i'm missing allow 2 control points). can work out given enough time, use coming theoretical/algorithmic solution this.

is there out there tackles this?


Comments