Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Signed Distance Function - 3D Plane

I truly love IQ's page and the information within regarding SDF's:
(https://www.iquilezles.org/www/articles/distfunctions/distfunctions.htm)

I have a few figured out but but his sdPlane is getting me..

float sdPlane( vec3 p, vec4 n )
{
  // n must be normalized
  return dot(p,n.xyz) + n.w;
}  

He doesn't identify what the input 'n' is being used for and I am not the greatest in math.
Something like the Width, Height, Depth from point p, but then n.w doesn't make sense..

Any help will be awesome, Thanks!

like image 253
Podis Avatar asked Sep 18 '25 13:09

Podis


1 Answers

n is a Plane Equation. .xyz is the normal vector of the plane and .w is the distance from origin.

like image 149
Rabbid76 Avatar answered Sep 21 '25 08:09

Rabbid76