The ray from the eye through point (x, y) of the window (-1 to 1 across it, y up: as the event handler's positions), in the root frame, as at the last frame: its origin (the eye; in an orthographic view, on the eye's plane) and its direction (a unit vector). False before the first frame. E.g. where the cursor points on a plane: vkf_pick's ray_plane.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(WindowProxy), | intent(in) | :: | self | |||
| real(kind=wp), | intent(in) | :: | x |
-1 to 1 across the window, y up |
||
| real(kind=wp), | intent(in) | :: | y |
-1 to 1 across the window, y up |
||
| real(kind=wp), | intent(out) | :: | origin(3) |
root frame (direction: a unit vector) |
||
| real(kind=wp), | intent(out) | :: | direction(3) |
root frame (direction: a unit vector) |
logical function cursor_ray(self, x, y, origin, direction) result(ok) class(WindowProxy), intent(in) :: self real(wp), intent(in) :: x, y !! -1 to 1 across the window, y up real(wp), intent(out) :: origin(3), direction(3) !! root frame (direction: a unit vector) type(PickCamera) :: cam origin = 0.0_wp direction = [0.0_wp, 0.0_wp, -1.0_wp] ok = view_camera(self, x, y, cam) if (ok) call ray(cam, origin, direction) end function cursor_ray