小编Bru*_*lia的帖子

JavaFX 中抛物线轨迹的时间线

抱歉,我还是不明白。我的问题是我对物理一无所知,但我的老师分配给我这个项目。

private void shoot() {        
    Group group = new Group();
    double angle = cannon.getRotate();
    double speed = slider.getValue();
    double x = cannon.getLayoutX();
    double y = cannon.getLayoutY();
    double v0X = Math.cos(angle)*speed;
    double voY = Math.sin(angle)*speed;        
    Circle c = new Circle(x, y, 8, Color.BLACK);
    /*t is the time, but I don't know its 
    value or has it the same value of the KeyFrame duration? */
    double x2 = x + voX*t;
    double y2 = y + v0Y * t - 0.5 * …
Run Code Online (Sandbox Code Playgroud)

java javafx

1
推荐指数
1
解决办法
1348
查看次数

标签 统计

java ×1

javafx ×1