raymarching sdf模型 plane float sdPlane vec3 p vec3 n float h n must be normalized return dotpn + h;
The function sdPlane calculates the signed distance from a point p to a plane defined by its normal vector n and a distance h from the origin. The normal vector n must be normalized before using it in this function.
The signed distance is calculated by taking the dot product of the point p and the normal vector n, and adding the distance h. This will give a positive value if the point is on the side of the plane that the normal vector is pointing towards, and a negative value if it is on the opposite side
原文地址: https://www.cveoy.top/t/topic/hZcs 著作权归作者所有。请勿转载和采集!