XMPlaneFromPointNormal function (directxmath.h)

Computes the equation of a plane constructed from a point in the plane and a normal vector.

Syntax

XMVECTOR XM_CALLCONV XMPlaneFromPointNormal(
  [in] FXMVECTOR Point,
  [in] FXMVECTOR Normal
) noexcept;

Parameters

[in] Point

3D vector describing a point in the plane.

[in] Normal

3D vector normal to the plane.

Return value

Returns a vector whose components are the coefficients of the plane (A, B, C, D) for the plane equation

XMVECTOR Result;

Result.x = Normal.x;
Result.y = Normal.y;
Result.z = Normal.z;
Result.w = -(Point.x * Normal.x + Point.y * Normal.y + Point.z * Normal.z);

return Result;

.

Remarks

The following pseudocode demonstrates the operation of the function:

Ax+By+Cz+D=0

Platform Requirements

Microsoft Visual Studio 2010 or Microsoft Visual Studio 2012 with the Windows SDK for Windows 8. Supported for Win32 desktop apps, Windows Store apps, and Windows Phone 8 apps.

Requirements

Requirement Value
Target Platform Windows
Header directxmath.h

See also

DirectXMath Library Plane Functions