In , computer researcher Martin Newell needed a new 3D model for his work. In these days of age, very few models where available to the computer graphics community and creating them was also far from easy. Most models had to get their points entered in the computer program by hand or with a graphics tablet "a computer input device that allows hand-drawn images and graphics to be input. It may be used to trace an image from a piece of paper laid on the surface. Capturing data in this way is called digitizing". The story goes that Newell drew a teapot he had at home and digitized these drawings to create the model we know today as the Utah Teapot figure 1.
|Published (Last):||12 May 2010|
|PDF File Size:||20.98 Mb|
|ePub File Size:||20.61 Mb|
|Price:||Free* [*Free Regsitration Required]|
In , computer researcher Martin Newell needed a new 3D model for his work. In these days of age, very few models where available to the computer graphics community and creating them was also far from easy. Most models had to get their points entered in the computer program by hand or with a graphics tablet "a computer input device that allows hand-drawn images and graphics to be input. It may be used to trace an image from a piece of paper laid on the surface.
Capturing data in this way is called digitizing". The story goes that Newell drew a teapot he had at home and digitized these drawings to create the model we know today as the Utah Teapot figure 1. The teapot is now usually available in rendering or modeling programs along with other geometric primitives, such as spheres, cubes, tori, etc. One of the interesting properties of the teapot created by Newell is that the mathematical model used to define the surface of the object is very compact.
The teapot contains 32 patches each defined by 16 points the original data set contains 28 patches. You might wonder: "how it is possible to create a complex and smooth shape such as the teapot with such few points? The main idea of the technique is that these 16 points do not define the vertices of polygons as with the polygon mesh we have studied in the previous section.
They represent the control points of something like a grid or lattice that influence the shape of an underlying smooth surface. You can see these points as magnets that push or pull the underlying surface. To visualise it, we need to compute it by combining together these 16 controls point weighted by some coefficients.
Because the creation of the surface is based on equations it falls under the category of parametric surfaces. The principle of this technique is easier to understand with curves than with surfaces. Its application to 3D surfaces though is straightforward. These point are control points defined in 3D space. How do we compute this curve? Parametric curves are curves which are defined by an equation.
As with every equation, this equation has a variable, which in the case of parametric curve, is called a parameter. It can as well go from minus to plus infinity.
In the case of a Bezier curve though, we will only need value of t going from 0 to 1. Figure 4: example of a parametric curve plot of a parabola. Figure 5: legend a curve can be approximated by connecting a finite number of points on the curve using line segments to create a polygonal path. With only 4 segments we can start to see what the overall shape of the curve looks like. To get a smoother result all there is to do is to increase the number of points and segments.
We will sample it at regular intervals and connect the point to create a series of connected line segments. The question now is how do we compute these positions? As you can see the principle is very simple. All you need to create this curve, are 4 control points which you move around to give the curve the shape you want. Each time you change one of these control points, to visualise the new curve, the code above needs to be re-executed.
Now that we understand the principle of this method, we will generalise and formalise it. We can re-write the equation we use above to compute P equation 1 in a more formal way. They can easily be computed using factorials the! It is actually possible to change the value of n remember that the degree of a polynomial is the largest degree of any one term in this polynomial. The technique of actually weighting control points by some coefficients which are themselves the result of some equations is a very common practice in CG.
It also helps to appreciate how powerful it can be in general as a mathematical tool. In our particular case, we use it to model a curve in 3D space but imagine that the curve is actually a function, then with just a few points and a few coefficients we would have a compact way of encoding more complex for example discrete functions. This is actually in essence how spherical harmonics work or similar to the principle of DCTs which we explain in the 2D section.
The same principle is also used for other types of curves or surfaces such as NURBs. Note that we have ordered the terms from the previous equations by decreasing exponent value.
We will develop this topic in a future version of this lesson. The De Casteljau algorithm is numerically more stable way compared to using the parametric form directly of evaluating the position of a point on the curve for any given t it only requires a series of linear interpolation. The principle of the algorithm relies on computing intermediate positions on each one of the three segments defined by the four control points by linearly interpolating the control points for a given t.
The result of this process are three points which can themselves be connected to each other to form two line segments. We repeat the linear interpolation on these two line segments from which we get two new positions which again we can interpolate. The final point we get from this process lies on the curve at t this process is illustrated in figure 7. We already know that the first and end point of the curve coincide with the first and fourth control point.
The line P1-P2 and P3-P4 are also tangent to the first and end point of the curve. This property can be used to either extend an existing Bezier curve by joining several curves together or splitting an existing curve in two see further down. The control points P3 P4 from the first curve red and the points P1 P2 from the second curve orange are collinear. A 0th order continuity means that the curves are only joined the last and first point of the first and second curve do join but are not tangent.
P1, P12, P and P form the control points of the first sub-curve magenta , and P, P, P34, P4 form the control points of the second sub-curve green. The technique to split the curve relies on the De Casteljau algorithm presented above. If you look at the final image of the animation in figure 7 which we have reproduced in figure 10 , it is intuitively possible to see that two sub-curves can be built from the points P1, P12, P and P for the first sub-curve and P, P, P34 and P4 for the second sub-curve.
Note that by default, we use seven control points. When the control points P2, P3 and P4 are aligned, then we have a curve with 1st order continuity at P3 the curve appears smooth at this point.
It has no break. We say that the two curves are C1 continuous at the joining point. If you move P2 or P4 in such a way that P2, P3 and P4 are not aligned anymore you can alternatively move P3 , note how a break appears at P3.
With seven control points, we can interpret the curve as a curve with three points P0, P3 and P6 and three tangents if P2, P3 and P4 are aligned or four tangents if they are not we say the tangents are broken at P3. To modify the length and the orientation of these tangents you can change the position of the points P1, P2, P4 and P5. You can force the tangents P2-P3 and P3-P4 to be unbroken by forcing P2, P3 and P4 to stay aligned when you move any of these three points.
Of you course, you can keep adding more points to create longer curves or curves with more complex shapes. Chapter 1 of 6.
德卡斯特里奥算法（De Casteljau’s Algorithm）绘制贝塞尔曲线
When has a value of 0, you will get point. When has a value of 1, you will get point. The next simplest version of a Bezier curve is a quadratic curve, which has a degree of 2 and control points. A quadratic curve is just a linear interpolation between two curves of degree 1 aka linear curves. Specifically, you take a linear interpolation between , and a linear interpolation between , and then take a linear interpolation between those two results. That will give you your quadratic curve.
Algorithme de Casteljau