LinePlaneIntersection
From Solid Graphics Wiki
| ||||||||||||
The LinePlaneIntersection function calculates a line's intersection with a plane.
float LinePlaneIntersection
(
const float lStart[ 3 ],
const float lEnd[ 3 ],
const float plane[ 4 ],
float ip[ 3 ] = NULL
);
double LinePlaneIntersection
(
const double lStart[ 3 ],
const double lEnd[ 3 ],
const double plane[ 4 ],
double ip[ 3 ] = NULL
);
Parameters
| lStart | x,y,z coordinates of line's first definition point. |
| lEnd | x,y,z coordinates of line's second definition point. |
| plane | four float/double values defining the plane. |
| ip | if not NULL and the line intersects the plane then the function will put coordinates of the intersection point to the variable pointed by ip. |
Return Value
The function returns -FLT_MAX if the line does not intersect the plane. If the line intersects the plane then the function returns position of the intersection point on the line. The position can be then translated to point coordinates using the LinePositionToPoint function.
See Also
