-
Notifications
You must be signed in to change notification settings - Fork 2
raylib.GetScreenToWorldRay
JoeStrout edited this page Apr 29, 2026
·
2 revisions
Get a ray trace from screen position (i.e mouse)
| Parameter | Default Value | Note |
|---|---|---|
| position | ||
| camera |
| Condition | Return Value |
|---|---|
| (always) | map |
cam = {position:[0,5,10], target:[0,0,0], up:[0,1,0], fovy:45, projection:raylib.CAMERA_PERSPECTIVE}
mousePos = raylib.GetMousePosition
ray = raylib.GetScreenToWorldRay(mousePos, cam)
print "Ray direction: " + ray.direction[0] + ", " + ray.direction[1] + ", " + ray.direction[2]