Brief Index      Full Index      I.M. Reference

Compute_Transformed_Plane


Functions

void Compute_Transformed_Plane (const HC_PLANE *plane, const float *matrix, HC_PLANE *out_plane)
void Compute_Transformed_Planes (int count, const HC_PLANE *planes, const float *matrix, HC_PLANE *out_planes)

Function Documentation

void Compute_Transformed_Plane ( const HC_PLANE *  plane,
const float *  matrix,
HC_PLANE *  out_plane 
)

Applies a user-defined transform to a single plane.

Parameters:
plane - Input plane equation parameters (a,b,c,d).
matrix - Input transformation matrix.
out_plane - Plane equation parameters (a,b,c,d ). Returned to the caller. Can point to the same place as plane.

DETAILS

Compute_Transformed_Plane() accepts a general 4x4 matrix, inverts it, multiplies it on the right by the plane equation, and normalizes the result. This action produces a new plane equation. The first three values of the transformed plane represent the transformed normal vector. If the matrix or the transformed plane is singular, false is returned and out_plane is unchanged. If you have many planes to convert it might be more efficient to invert the matrix (or, better, to find the adjoint) once, then multiply the planes through it by hand.

NOTES

Since by nature a plane transform involves a (expensive) matrix adjoint calculation, it is important for performance reasons to use the Compute_Transformed_Planes() variant whenever you have a large number of planes that need to be transformed by the same matrix.

RESTRICTIONS

See also:
Compute_Coordinates, Compute_Polygon_Plane, Compute_Transform, Set_Modelling_Matrix, Show_Device_Info, Show_Geometry_Pointer, Show_Polygon, Show_Shelletc.

void Compute_Transformed_Planes ( int  count,
const HC_PLANE *  planes,
const float *  matrix,
HC_PLANE *  out_planes 
)

Applies a user-defined transform to a group of planes.

Parameters:
count - Number of plane equations in planes
planes - A 4 x count array of plane equation parameters (a,b,c,d). planes
matrix - Input transformation matrix.
out_planes - Plane equation parameters (a,b,c,d ). Returned to planes the caller. Can point to the same place as plane.

DETAILS

No additional details. See Compute_Transformed_Plane()

Main Index
Brief Index      Full Index      I.M. Functions