opengl and parametric curves advanced multimedia technology: computer graphics yung-yu chuang...
TRANSCRIPT
![Page 1: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/1.jpg)
OpenGL and Parametric Curves
Advanced Multimedia Technology: Computer GraphicsYung-Yu Chuang2005/12/21
with slides by Brian Curless, Zoran Popovic, Robin Chen and Doug James
![Page 2: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/2.jpg)
Review of graphics pipeline
Transformation
![Page 3: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/3.jpg)
Review of graphics pipeline
Projection & clipping
![Page 4: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/4.jpg)
Review of graphics pipeline
• Rasterization • Visibility
![Page 5: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/5.jpg)
Review of graphics pipeline
• Shading
![Page 6: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/6.jpg)
Hierarchical modeling: a robot arm
![Page 7: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/7.jpg)
First implementation
![Page 8: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/8.jpg)
Better implementation
![Page 9: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/9.jpg)
OpenGL implementation
![Page 10: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/10.jpg)
Hierarchical modeling
![Page 11: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/11.jpg)
Implementation
![Page 12: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/12.jpg)
Human with hands
![Page 13: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/13.jpg)
Better implementation
![Page 14: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/14.jpg)
OpenGL implementation
![Page 15: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/15.jpg)
OpenGL
• A low-level OS-independent graphics API for 2D and 3D interactive graphics.
• Initiated by SGI (called GL at early time)• Implementation, for Windows, hardware
vendors provide suitable drivers for their own products; for Linux, we have Mesa.
![Page 16: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/16.jpg)
Helper libraries
• OpenGL does not provide OS-dependent functions such as windowing and input– GL: core graphics functions– GLU: graphics utilities in top of GL– GLUT: input and windowing functions
![Page 17: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/17.jpg)
How does it work?
• From the programmer’s view– Specify geometric properties of the objects– Describe material properties– Define viewing– Define camera and object transformations
• OpenGL is a state machine– States: color, material properties, line width,
current viewing – States are applied to subsequent drawing
commands– Input: description of geometric objects– Output: shaded pixels
![Page 18: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/18.jpg)
How does it work
• From the implementer’s perspective• Graphics pipeline
Primitives+ materialproperties
RotateTranslateScale
Is itVisible?
3D to 2D Scan conversionVisibilitydetermination
Display
![Page 19: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/19.jpg)
Primitives: drawing a polygon
// put GL into polygon drawing mode
glBegin(GL_POLYGON);
// define vertices
glVertex2f(x0, y0);
glVertex2f(x1, y1);
glVertex2f(x2, y2);
glEnd();
Code available at http://www.xmission.com/~nate/tutors.html
![Page 20: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/20.jpg)
Primitives
Hardware may be more efficient on triangles; stripes require less data
![Page 21: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/21.jpg)
Polygon restrictions
• In OpenGL, polygons must be simple and convex
not simple not convex
![Page 22: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/22.jpg)
Attributes
• Part of the state of the graphics pipeline• Set before primitives are drawn. • Remain in effect!• Example:
– Color, including transparency– Reflection properties– Shading properties
![Page 23: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/23.jpg)
Primitives: material properties
• glColor3f(r,g,b);
All subsequent primitives will use this color. Colors are not attached to objects. The above command only changes the system states.
• OpenGL uses red, green and blue color model. Each components are ranged within 0 and 1.
![Page 24: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/24.jpg)
Primitives: material properties
![Page 25: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/25.jpg)
Simple transformations
• Rotate by a given angle (in degrees) about ray from origin through (x,y,z)
glRotate{fd}(angle, x, y, z);• Translate by a given x, y, z values
glTranslate{fd}(x, y, z);• Scale with a factor in the x, y, and z directions
glScale{fd}(x, y, z);
• glPushMatrix(); glPopMatrix();
![Page 26: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/26.jpg)
Orthographic projection
• glOrtho(left, right, bottom, top, near, far);
![Page 27: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/27.jpg)
Camera transformations
• gluLookAt(eyex, eyey, eyez, cx, cy, cz, upx, upy, upz);
![Page 28: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/28.jpg)
Example: drawing a box
![Page 29: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/29.jpg)
Example: drawing a shaded polygon
![Page 30: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/30.jpg)
Initializing attributes
![Page 31: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/31.jpg)
Callback functions
• Handle “events”, Idle, Keyboard, Mouse, Menu, Motion, Reshape
• The display callback is installed by glutDisplayFunc()
![Page 32: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/32.jpg)
Actual drawing function
![Page 33: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/33.jpg)
Results
glShadeModel(GL_FLAT) glShadeModel(GL_SMOOTH)
![Page 34: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/34.jpg)
Depth buffer in OpenGL
• glutInitDisplayMode(GLUT_DEPTH);• glEnable(GL_DEPTH_TEST);• glClear(GL_DEPTH_BUFFER_BIT);
![Page 35: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/35.jpg)
Double buffering
• Flicker if drawing overlaps screen refresh• Solution: use two frame buffers
– Draw into one buffer– Swap and display, while drawing other buffer
• glutInitDisplayMode(GLUT_SINGLE)• glutInitDisplayMode(GLUT_DOUBLE)• glutSwapBuffers()
![Page 36: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/36.jpg)
Example: rotate a color cube
• Step 1: define the vertices
![Page 37: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/37.jpg)
Example: rotate a color cube
• Step 2: enable depth testing and double buffering
![Page 38: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/38.jpg)
Example: rotate a color cube
• Step 3: create window and set callbacks
![Page 39: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/39.jpg)
Example: rotate a color cube
• Step 4: reshape callback, enclose cube, preserve aspect ratio
![Page 40: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/40.jpg)
Example: rotate a color cube
• Step 5: display callback, clear, rotate, draw, flush, swap
![Page 41: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/41.jpg)
Example: rotate a color cube
• Step 6: draw cube by drawing faces, orientation consistency
![Page 42: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/42.jpg)
Example: rotate a color cube
• Step 7: drawing face
![Page 43: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/43.jpg)
Example: rotate a color cube
• Step 8: animation, set idle callback spinCube()
![Page 44: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/44.jpg)
Example: rotate a color cube
• Step 9: change axis of rotation using mouse callback
![Page 45: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/45.jpg)
Example: rotate a color cube
• Step 10: toggle rotation or exit using keyboard callback
![Page 46: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/46.jpg)
Mathematical curve representation
![Page 47: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/47.jpg)
Parametric polynomial curves
![Page 48: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/48.jpg)
Cubic curves
N too small → less flexibility in controlling the shape of the curveN too large → often introduce unwanted wiggles
![Page 49: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/49.jpg)
Compact representation
![Page 50: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/50.jpg)
Constrain the cubics
Hermite: defined by two endpoints and two endpoint tangent vectorsBezier: defined by two endpoints and two other points that control the endpoint tangent vectorsSpline: defined by four control points
![Page 51: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/51.jpg)
Hermite curves
![Page 52: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/52.jpg)
Computing Hermite basis matrix
![Page 53: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/53.jpg)
Computing Hermite basis matrix
![Page 54: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/54.jpg)
Computing a point
![Page 55: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/55.jpg)
Blending functions
![Page 56: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/56.jpg)
Bezier curves
![Page 57: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/57.jpg)
Bezier basis matrix
![Page 58: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/58.jpg)
Bezier basis matrix
![Page 59: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/59.jpg)
Bezier blending function
![Page 60: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/60.jpg)
Alternative (de Casteljau’s algorithm)
![Page 61: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/61.jpg)
Finding Q(u)
![Page 62: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/62.jpg)
Bezier curve
•each is between 0 and 1•sum of all four is exactly 1
Curve lies within the convex Hull of its control points
![Page 63: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/63.jpg)
Displaying Bezier curves
![Page 64: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/64.jpg)
Testing for flatness
![Page 65: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/65.jpg)
What do we want for a curve?
• Local control• Interpolation• Continuity
![Page 66: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/66.jpg)
Local control
• One problem with Bezier curve is that every control points affect every point on the curve (except for endpoints). Moving a single control point affects the whole curve.• We’d like to have local control, that is, have each control point affect some well-defined neighborhood around that point.
![Page 67: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/67.jpg)
Interpolation
• Bezier curves are approximating. The curve does not necessarily pass through all the control points. We’d like to have a curve that is interpolating, that is, that always passes through every control points.
![Page 68: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/68.jpg)
Continuity
• We want our curve to have continuity: there shouldn’t be any abrupt changes as we move along the curve.
![Page 69: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/69.jpg)
Splines• We will splice together a curve from individual
Bezier segments. We call these curves splines. When splicing Bezier together, we need to worry about continuity.
![Page 70: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/70.jpg)
Ensuring C0 continuity
![Page 71: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/71.jpg)
1st derivatives at the endpoints
![Page 72: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/72.jpg)
Ensuring C1 continuity
![Page 73: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/73.jpg)
The C1 Bezier spline
![Page 74: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/74.jpg)
Catmull-Rom splines
![Page 75: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/75.jpg)
Catmull-Rom basis matrix
3
2
1
0
61
61
61
61
3
2
1
0
0100
10
01
0010
P
P
P
P
V
V
V
V
3
2
1
0
3
2
1
0
0001
0033
0363
1331
)()(
V
V
V
V
T
V
V
V
V
tBtQ b
![Page 76: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/76.jpg)
2nd derivatives at the endpoints
![Page 77: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/77.jpg)
Ensuring C2 continuity
![Page 78: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/78.jpg)
A-frames and continuity
![Page 79: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/79.jpg)
B-spline
![Page 80: OpenGL and Parametric Curves Advanced Multimedia Technology: Computer Graphics Yung-Yu Chuang 2005/12/21 with slides by Brian Curless, Zoran Popovic, Robin](https://reader036.vdocuments.site/reader036/viewer/2022062517/56649ebc5503460f94bc50ea/html5/thumbnails/80.jpg)
B-spline