FXyz icon indicating copy to clipboard operation
FXyz copied to clipboard

RayShooting needs update

Open Birdasaur opened this issue 3 years ago • 2 comments

This example currently relies on an internal call:

https://github.com/FXyz/FXyz/blob/0d11609acfdb0316ed797337d27933a33902cbe0/FXyz-Samples/src/main/java/org/fxyz3d/samples/utilities/RayShooting.java#L103

Point3D o = CameraHelper.pickProjectPlane(camera, e.getX(), e.getY());

which is no longer exposed. I'd really like to push a fix for this... but I wasn't sure if there is a valid publically accesible replacement for the old pickProjectPlane()? @jperedadnr is there an FXYZ way to do this that I just haven't seen yet?

Birdasaur avatar Jan 30 '22 16:01 Birdasaur

I don't think there is a public way. For now --add-exports might still work.

jperedadnr avatar Jan 31 '22 11:01 jperedadnr

Hmmm. What I want it for ... I may not need it. I'm looking to animate some moving points through a 3D scene. Jason used the pickPlane to obtain the Point3D associated with the mouse click in that example yes? If so then as long as I have my initial condition for the Ray as a Point3D then I wouldn't need it. Could we possibly replace the pickPlaneProject with subsceneToLocal transform? Or did that helper method also determine what (if any) node was "picked" and then set the point3d at that location?

Birdasaur avatar Jan 31 '22 13:01 Birdasaur

I am removing the CameraHelper reference and implementing a separate "origin" shape that you can move around. Then whenever the user fires a ray it will emit from the current location of the origin shape. Its good enough and demonstrates the original purpose of the example.

Birdasaur avatar Jan 14 '23 15:01 Birdasaur