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 platform. I would like some info e.g. if the mouse hovers a 3d object. Is that possible in any way (Maybe with the given camera translations etc.)?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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());
});
}