You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JoeStrout edited this page Nov 16, 2026
·
3 revisions
Compute the direction of a refracted ray. v: normalized direction of the incoming ray; n: normalized normal vector of the interface between the two media; r: ratio of the refractive index of the medium the ray comes from to that of the medium on the other side
Parameters
Parameter
Default Value
Note
v
[0, 0]
n
[0, 1]
r
1
Return value
Condition
Return Value
(always)
list
Notes
Example
v= [0, -1] // normalized incoming ray (straight down)n= [0, 1] // surface normal pointing upr=0.9// ratio of refractive indicesresult=raylib.Vector2Refract(v, n, r)
printresult