//============================================================================
// homoclip.cpp : polygon clipping in homogeneous coordinates
//============================================================================

//----------------------------------------------------------------------------
// Clips a 4D homogeneous polygon defined by the packed array of float InPts.
// to the viewing frustum defined by w components of the verts. The clipped polygon is
// put in OutPts (which must be a different location than InPts) and the number
// of vertices in the clipped polygon is returned. InPts must have NumInPts*4
// floats (enough to contain poly). Regular orthographic NDC clipping can be 
// achieved by making the w coordinate of each point be 1. OutPts will be
// allocated and return filled with the clipped polygon (could contain as 
// many as (NumInPts+6)*4 floats)
//----------------------------------------------------------------------------
int ClipPolyToFrustum(float *InPts, const int NumInPts, float* &OutPts)
{
  OutPts = new float[(NumInPts+6)*4];

  // CLIP InPts TO OutPts IN HOMOGENEOUS COORDS

  return(NumOutPts);
}
