JavaFX 3D Graphics: Mouse click position on 3D object

后端 未结 1 486
终归单人心
终归单人心 2021-01-16 18:20

I just played around with the Oracle JavaFX Sample 3D Graphics app I am wondering if it is possible to calculate the current mouse position relative to the 3d platfo

相关标签:
1条回答
  • 2021-01-16 18:35

    You can use the PickResult class from any MouseEvent, this is just the basic usage ..

    ...{
        shape3D.setOnMouseEntered(e->{
            PickResult pr = e.getPickResult();
            System.out.println(pr.getIntersectedPoint());
        });
    }
    
    0 讨论(0)
提交回复
热议问题