Ninja Library - Collision Function

njGetPlaneNormal

Finds the vector that is normal to a plane

FORMAT

void njGetPlaneNormal(*p, *v)
NJS_POINT3 *p
NJS_VECTOR *v

PARAMETER

 *p  Data array describing three points in the plane 
 *v  Normal vector to the plane 

RETURN

None

DESCRIPTION

Finds the vector that is normal to a plane.

EXAMPLE

The following finds the vector that is normal to the plane passing 
through points (1, 2, 3), (1, -1, 2), and (2, 3, 1).

NJS_POINT3 p[3];
NJS_VECTOR v;
p[0].x = 1.f;
p[0].y = 2.f;
p[0].z = 3.f;
p[1].x = 1.f;
p[1].y = -1,f;
p[1].z = 2.f;
p[2].x = 2.f;
p[2].y = 3.f;
p[2].z = 1.f;
njGetPlaneNormal(p, &v);
% Result %
v (7, -1, 3)

njGetPlaneNormal
COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999