A Bezier curve can be measured in "u". At the first control point u=0. At the last, u=1 and at the other two control points, u=1/3 and u=2/3. This is applied to patches, so that one edge is measured in "u". The transverse edge is also a Bezier curve measured in "v", with control points at v=0, v=1/3, v=2/3 and v=1. This notation is used in some functions.
The Toolkit functions fall into four groups.
|
|
RtBezierMatrix typedef for a matrix of 4*4 vectors. RtBezierMatrix is an array of 4 rows. |
|
|
RtBezierRow typedef for a row of vectors. RtBezierRow is an array of 4 vectors |
|
||||||||||||
|
RtBezierQuadBernsteinWeight3d returns a Bernstein weighted matrix for an input control point matrix, addressing x, y, and z coordinates. Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.
|
|
||||||||||||
|
RtBezierQuadBernsteinWeight4d returns a Bernstein weighted matrix for an input control point matrix, addressing x, y, z, and w coordinates. Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.
|
|
||||||||||||
|
RtBezierQuadControlFit3d returns the control points for a Bezier quadrilateral fitted to pass through the supplied sample points, addressing x, y, and z coordinates.
|
|
|
RtBezierQuadDifferenceStepU3d updates a difference row for a step in the u patch parameter addressing x, y, and z coordinates. Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.
static RtBezierMatrix control =
{
{{00,00,00,-1}, {30,00,00,-1}, {60,00,00,-1}, {90,00,00,-1}},
{{00,30,00,-1}, {30,30,30,-1}, {60,30,00,-1}, {90,30,00,-1}},
{{00,60,00,-1}, {30,60,90,-1}, {60,60,60,-1}, {90,60,00,-1}},
{{00,90,00,-1}, {30,90,00,-1}, {60,90,00,-1}, {90,90,90,-1}}
};
RwInt32 j;
RtBezierMatrix weight;
RtBezierMatrix difference;
RtBezierQuadBernsteinWeight3d(weight, control);
RtBezierQuadOriginDifference3d(difference, weight,
((RwReal) 1) / ((RwReal) 8),
((RwReal) 1) / ((RwReal) 8));
for (j = 0; j <= 8; j++)
{
const RwReal v = ((RwReal) j) / ((RwReal) resV);
RtBezierRow row;
RwInt32 i;
row[0] = difference[0][0];
row[1] = difference[0][1];
row[2] = difference[0][2];
row[3] = difference[0][3];
for (i = 0; i <= 8; i++)
{
const RwReal u = ((RwReal) i) / ((RwReal) 8);
// row[0] now contains the point at (u,v) on the Bezier surface
RtBezierQuadDifferenceStepU3d(row);
}
RtBezierQuadDifferenceStepV3d(difference);
}
|
|
|
RtBezierQuadDifferenceStepU4d updates a difference row for a step in the u patch parameter, addressing x, y, z, and w coordinates. Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.
static RtBezierMatrix control =
{
{{00,00,00,-1}, {30,00,00,-1}, {60,00,00,-1}, {90,00,00,-1}},
{{00,30,00,-1}, {30,30,30,-1}, {60,30,00,-1}, {90,30,00,-1}},
{{00,60,00,-1}, {30,60,90,-1}, {60,60,60,-1}, {90,60,00,-1}},
{{00,90,00,-1}, {30,90,00,-1}, {60,90,00,-1}, {90,90,90,-1}}
};
RwInt32 j;
RtBezierMatrix weight;
RtBezierMatrix difference;
RtBezierQuadBernsteinWeight4d(weight, control);
RtBezierQuadOriginDifference4d(difference, weight,
((RwReal) 1) / ((RwReal) 8),
((RwReal) 1) / ((RwReal) 8));
for (j = 0; j <= 8; j++)
{
const RwReal v = ((RwReal) j) / ((RwReal) resV);
RtBezierRow row;
RwInt32 i;
row[0] = difference[0][0];
row[1] = difference[0][1];
row[2] = difference[0][2];
row[3] = difference[0][3];
for (i = 0; i <= 8; i++)
{
const RwReal u = ((RwReal) i) / ((RwReal) 8);
// row[0] now contains the point at (u,v) on the Bezier surface
RtBezierQuadDifferenceStepU4d(row);
}
RtBezierQuadDifferenceStepV4d(difference);
}
|
|
|
RtBezierQuadDifferenceStepV3d updates a difference matrix for a step in the v patch parameter, addressing x, y, and z coordinates. Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.
static RtBezierMatrix control =
{
{{00,00,00,-1}, {30,00,00,-1}, {60,00,00,-1}, {90,00,00,-1}},
{{00,30,00,-1}, {30,30,30,-1}, {60,30,00,-1}, {90,30,00,-1}},
{{00,60,00,-1}, {30,60,90,-1}, {60,60,60,-1}, {90,60,00,-1}},
{{00,90,00,-1}, {30,90,00,-1}, {60,90,00,-1}, {90,90,90,-1}}
};
RwInt32 j;
RtBezierMatrix weight;
RtBezierMatrix difference;
RtBezierQuadBernsteinWeight3d(weight, control);
RtBezierQuadOriginDifference3d(difference, weight,
((RwReal) 1) / ((RwReal) 8),
((RwReal) 1) / ((RwReal) 8));
for (j = 0; j <= 8; j++)
{
const RwReal v = ((RwReal) j) / ((RwReal) resV);
RtBezierRow row;
RwInt32 i;
row[0] = difference[0][0];
row[1] = difference[0][1];
row[2] = difference[0][2];
row[3] = difference[0][3];
for (i = 0; i <= 8; i++)
{
const RwReal u = ((RwReal) i) / ((RwReal) 8);
// row[0] now contains the point at (u,v) on the Bezier surface
RtBezierQuadDifferenceStepU3d(row);
}
RtBezierQuadDifferenceStepV3d(difference);
}
|
|
|
RtBezierQuadDifferenceStepV4d updates a difference matrix for a step in the v patch parameter, addressing x, y, z, and w coordinates. Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.
static RtBezierMatrix control =
{
{{00,00,00,-1}, {30,00,00,-1}, {60,00,00,-1}, {90,00,00,-1}},
{{00,30,00,-1}, {30,30,30,-1}, {60,30,00,-1}, {90,30,00,-1}},
{{00,60,00,-1}, {30,60,90,-1}, {60,60,60,-1}, {90,60,00,-1}},
{{00,90,00,-1}, {30,90,00,-1}, {60,90,00,-1}, {90,90,90,-1}}
};
RwInt32 j;
RtBezierMatrix weight;
RtBezierMatrix difference;
RtBezierQuadBernsteinWeight4d(weight, control);
RtBezierQuadOriginDifference4d(difference, weight,
((RwReal) 1) / ((RwReal) 8),
((RwReal) 1) / ((RwReal) 8));
for (j = 0; j <= 8; j++)
{
const RwReal v = ((RwReal) j) / ((RwReal) resV);
RtBezierRow row;
RwInt32 i;
row[0] = difference[0][0];
row[1] = difference[0][1];
row[2] = difference[0][2];
row[3] = difference[0][3];
for (i = 0; i <= 8; i++)
{
const RwReal u = ((RwReal) i) / ((RwReal) 8);
// row[0] now contains the point at (u,v) on the Bezier surface
RtBezierQuadDifferenceStepU4d(row);
}
RtBezierQuadDifferenceStepV4d(difference);
}
|
|
||||||||||||
|
RtBezierQuadFromTriangle takes a matrix of 10 control points for a tri patch, and returns a matrix of 16 control points for a quad patch. The side of the tri patch defined by control points 9-8-6-3 becomes quad patch's diagonal 12-9-6-3.
|
|
||||||||||||
|
RtBezierQuadGetNormals calculates the surface normals corresponding to the control points of a Bezier quadrilateral patch.
|
|
||||||||||||||||||||
|
RtBezierQuadOriginDifference3d returns a difference matrix for an input Bernstein weight matrix at the parameter origin, addressing x, y, and z coordinates. Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.
|
|
||||||||||||||||||||
|
RtBezierQuadOriginDifference4d returns a difference matrix for an input Bernstein weight matrix at the parameter origin, addressing x, y, z, and w coordinates. Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.
|
|
||||||||||||||||||||||||||||
|
RtBezierQuadPointDifference3d returns a difference matrix for an input Bernstein weight matrix at an arbitrary initial parameter point, addressing x, y, and z coordinates. Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.
|
|
||||||||||||||||||||||||||||
|
RtBezierQuadPointDifference4d returns a difference matrix for an input Bernstein weight matrix at an arbitrary initial parameter point, addressing x, y, z, and w coordinates. Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.
|
|
||||||||||||||||||||
|
RtBezierQuadSample3d returns a point on a Bezier patch at the specified parameter point, addressing x, y, and z coordinates.
static RtBezierMatrix control =
{
{{00,00,00,-1}, {30,00,00,-1}, {60,00,00,-1}, {90,00,00,-1}},
{{00,30,00,-1}, {30,30,30,-1}, {60,30,00,-1}, {90,30,00,-1}},
{{00,60,00,-1}, {30,60,90,-1}, {60,60,60,-1}, {90,60,00,-1}},
{{00,90,00,-1}, {30,90,00,-1}, {60,90,00,-1}, {90,90,90,-1}}
};
RwInt32 i;
RwInt32 j;
RwReal u;
RwReal v;
RwV3d p;
for (j = 0; j <= 8; j++)
{
v = ((RwReal) j) / ((RwReal) 8);
for (i = 0; i <= 8; i++)
{
u = ((RwReal) i) / ((RwReal) 8);
RtBezierQuadSample3d(&p, control, u, v);
// p now contains the point at (u,v) on the Bezier surface
}
}
|
|
||||||||||||||||
|
RtBezierQuadTangent returns a 16 control point matrix for the tangents over a Bezier quadrilateral.
|
|
||||||||||||||||||||
|
RtBezierQuadTangentPair returns 2 matrices, of 16 control points each, the tangents over a Bezier quadrilateral patch.
|
|
||||||||||||
|
RtBezierTriangleControlFit3d returns the control points for a Bezier triangle fitted to pass through the supplied sample points, addressing x, y, and z coordinates.
|
© 1993-2004 Criterion Software Limited. All rights reserved. Built Thu Feb 12 13:47:08 2004.
Send Feedback