Game Development Reference
In-Depth Information
How to do it...
The idea behind the rendering is quite simple. We let the individual quads move in a way that
their corners slide along four guiding curves. The following igure shows the same quad in a
series of positions:
The four curves show the paths of the quad's corners.
1.
We start with the helper Curve class, which implements the linear interpolation on
the set of control points. A curve is represented in a parametric form.
A parametric equation of a curve is a representation of this curve
through equations expressing the coordinates of the points of the
curve as functions of a variable called a parameter.
Courtesy: http://en.wikipedia.org/wiki/Parametric_equation
class Curve
{
public:
Curve() {}
2.
The AddControlPoint() method adds a new control point to the curve. The curve
is lazy-evaluated, and now we just store the speciied values:
void AddControlPoint( float t, const vec3& Pos )
{
T.push_back( t );
P.push_back( Pos );
}
 
Search WWH ::




Custom Search