我在JavaFX中创建圆形动画。用户输入诸如投掷角度和力量之类的变量,我的任务是创建此轨迹并制作抛出圆圈的动画。我已经做了轨迹,并且我能够获得圆圈的最终位置,但我仍然需要做cricle轨迹的动画。 我在循环中计算整个轨迹,然后绘制曲线。
左边的圆圈在投掷前,右边的圆圈在此动作之后。如何使用已绘制的轨迹为此圆圈设置动画? https://i.imgur.com/HlxQD8r.png
for(x = 0; x < Z; x=x+0.01){
y = x * Math.tan(angleRadians) - (gSpeed/mianownik) * Math.pow(x, 2); // some variables to calculate y position
y = 0 - y; //negation the real y position cause its kinda reverted
gc.strokeLine(x+10, y+100, x+10,y+100); // drawing line; +10 and +100 because (10, 100) is circle starting position
}
gc.fillOval(x,y+100,20,20); // drawing cricle after throw