Is there a way to pick a 3D node on the JFX scene with screen coordinates ?
Knowing that I am not using the Mouse, but use a Custom Touch Handler (Not the JFX Touch events).
What I've tried:
- Emulate a MouseEvent from the Touch Handler and fire the event. The PickResult got from the event is always null.
- Use the common way: Ray/Node collision by calling the (deprecated) method:
Node.impl_pickNode(pickray, result)
, so I tried to get the PickRay:- By calling:
Camera.computePickRay(double x, double y, PickRay pickRay)
, but the method is not public... - Build it, but I need to convert the screen coordinates in 3D coordinates, but don't know how to do it with the JFX API.
- By calling:
Thanks for any input !
Jose Pereda recently contributed a RayCasting example to the free open source F(X)yz library:
https://github.com/FXyz/FXyzLib/blob/master/src/org/fxyz/tests/RayTest.java
It is still in flux but it might give you everything you need. This is similar to this question where he and @jdub1581 try to explain javafx-8-3d-scene-intersection-point