-
Notifications
You must be signed in to change notification settings - Fork 2
raylib.GetWorldToScreen
JoeStrout edited this page Apr 29, 2026
·
2 revisions
Get the screen space position from a 3d world space position
| Parameter | Default Value | Note |
|---|---|---|
| position | ||
| camera |
| Condition | Return Value |
|---|---|
| (always) | list |
raylib.InitWindow 800, 600, "World To Screen Demo"
cam = {position:[0,5,10], target:[0,0,0], up:[0,1,0], fovy:45, projection:raylib.CAMERA_PERSPECTIVE}
while not raylib.WindowShouldClose
raylib.BeginDrawing
raylib.ClearBackground color.white
raylib.BeginMode3D cam
raylib.DrawGrid 10, 1
raylib.EndMode3D
screenPos = raylib.GetWorldToScreen([0,0,0], cam)
raylib.DrawCircle screenPos[0], screenPos[1], 8, color.red
raylib.EndDrawing
end while
raylib.CloseWindow