-
I am currently trying to get a point in the xyz scene based on where i clicked on the screen. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Here's an example for a plane, which I use for my neural network visualization, here: https://github.com/emer/emergent/blob/main/netview/events.go -- see ray := lo.RayPick(pos)
// layer is in XZ plane with norm pointing up in Y axis
// offset is 0 in local coordinates
plane := math32.Plane{Norm: math32.Vec3(0, 1, 0), Off: 0}
pt, ok := ray.IntersectPlane(plane)
Basically, the |
Beta Was this translation helpful? Give feedback.
Here's an example for a plane, which I use for my neural network visualization, here: https://github.com/emer/emergent/blob/main/netview/events.go -- see
LayerUnitAtPoint
, which takes an image point and returns the x,y coordinates in the plane. The core code is here:lo
is anxyz.Solid
Basically, the
math32.Ray
object has all the methods you might need to find more specific intersections.