Visualization LibraryA lightweight C++ OpenGL middleware for 2D/3D graphics |
[Home] [Tutorials] [All Classes] [Grouped Classes] |
#include <BezierSurface.hpp>

Public Types | |
| typedef std::vector < std::vector< dvec3 > > | Points |
| The control points grid defining the bicubic Bézier patch(es). | |
Public Member Functions | |
| virtual const char * | className () |
| Returns the name of the class. | |
| BezierPatch () | |
| Constructor. | |
| BezierPatch (int x, int y) | |
| Constructor. | |
| void | resize (int x, int y) |
| Defines the x and y dimensions of the control point grid defining the patch. | |
| int | x () const |
Returns the x dimension of the patch as specified by resize(). | |
| int | y () const |
Returns the y dimension of the patch as specified by resize(). | |
| Points & | points () |
| The control points grid defining the bicubic Bézier patch(es). | |
| const Points & | points () const |
| The control points grid defining the bicubic Bézier patch(es). | |
Protected Attributes | |
| Points | mControlPoints |
| int | mX |
| int | mY |
See also:
| typedef std::vector< std::vector<dvec3> > vl::BezierPatch::Points |
The control points grid defining the bicubic Bézier patch(es).
| vl::BezierPatch::BezierPatch | ( | ) | [inline] |
Constructor.
| vl::BezierPatch::BezierPatch | ( | int | x, | |
| int | y | |||
| ) | [inline] |
Constructor.
| virtual const char* vl::BezierPatch::className | ( | ) | [inline, virtual] |
| void BezierPatch::resize | ( | int | x, | |
| int | y | |||
| ) |
Defines the x and y dimensions of the control point grid defining the patch.
The x and y parameters must be of the form 3*n+1 with n integer positive, i.e 4 (n=1), 7 (n=2), 10 (n=3) and so on.
- The simplest bicubic Bézier patch requires 4x4 = 16 control points: A, B, C, D, E, F, G, H, I, L, M, N, O, P, Q, R - The Bézier surface is guaranteed to touch only the 4 corner control points A, D, O and R. A---B---C---D | | | | E---F---G---H | | | | I---L---M---N | | | | O---P---Q---R In this case we would call "resize(4,4)" - You can concatenate two bicubic Bézier patches to form a larger suface by sharing their control points like this: patch 1 patch 2 A---+---+---B---+---+---G | | | | | | | +---+---+---C---+---+---+ | | | | | | | +---+---+---D---+---+---+ | | | | | | | F---+---+---E---+---+---H In this case we would call "resize(7,4)" - In this case the two patches share the control points B, C, D and E. - As we can see the total control points needed are 28 = (2 (patches along x) * 3 + 1) * (1 (patches along y) * 3 + 1) - Also in this case the Bézier surface is guaranteed to touch only the 6 corner control points A, B, E, F, G and H.
| int vl::BezierPatch::x | ( | ) | const [inline] |
Returns the x dimension of the patch as specified by resize().
| int vl::BezierPatch::y | ( | ) | const [inline] |
Returns the y dimension of the patch as specified by resize().
| Points& vl::BezierPatch::points | ( | ) | [inline] |
The control points grid defining the bicubic Bézier patch(es).
| const Points& vl::BezierPatch::points | ( | ) | const [inline] |
The control points grid defining the bicubic Bézier patch(es).
Points vl::BezierPatch::mControlPoints [protected] |
int vl::BezierPatch::mX [protected] |
int vl::BezierPatch::mY [protected] |