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 Apr 29, 2026
·
2 revisions
Compute the direction of a refracted ray v: normalized direction of the incoming ray n: normalized normal vector of the interface of two optical media r: ratio of the refractive index of the medium from where the ray comes to the refractive index of the medium on the other side of the surface
Parameters
Parameter
Default Value
Note
v
[0, 0, 0]
n
[0, 1, 0]
r
1
Return value
Condition
Return Value
(always)
list
Notes
Example
v= [0, -1, 0] // normalized incoming ray (straight down)n= [0, 1, 0] // surface normal pointing upr=0.9// ratio of refractive indicesresult=raylib.Vector3Refract(v, n, r)
printresult