-
Notifications
You must be signed in to change notification settings - Fork 2
raylib.GetScreenToWorldRayEx
JoeStrout edited this page Apr 29, 2026
·
2 revisions
Get a ray trace from the screen position (i.e mouse) within a specific section of the screen
| Parameter | Default Value | Note |
|---|---|---|
| position | ||
| camera | ||
| width | 0 | |
| height | 0 |
| Condition | Return Value |
|---|---|
| (always) | map |
cam = {position:[0,5,10], target:[0,0,0], up:[0,1,0], fovy:45, projection:raylib.CAMERA_PERSPECTIVE}
// Cast a ray from a specific viewport section (800x600)
ray = raylib.GetScreenToWorldRayEx([400, 300], cam, 800, 600)
print "Ray direction: " + ray.direction[0] + ", " + ray.direction[1] + ", " + ray.direction[2]