收藏 分销(赏)

2Bezier曲线计算机图形学.pptx

上传人:可**** 文档编号:1638127 上传时间:2024-05-07 格式:PPTX 页数:42 大小:725.94KB
下载 相关 举报
2Bezier曲线计算机图形学.pptx_第1页
第1页 / 共42页
2Bezier曲线计算机图形学.pptx_第2页
第2页 / 共42页
2Bezier曲线计算机图形学.pptx_第3页
第3页 / 共42页
2Bezier曲线计算机图形学.pptx_第4页
第4页 / 共42页
2Bezier曲线计算机图形学.pptx_第5页
第5页 / 共42页
点击查看更多>>
资源描述

1、2024/4/22 周一交通运输学院CAD/CAM研究所1Chapter 8 Three-Dimensional Object Representations贝塞尔曲线曲面(Bzier Curves and Surfaces)Bzier曲线和曲面n法国工程师法国工程师Bzier使用逼近样条为雷诺汽车公司使用逼近样条为雷诺汽车公司设计汽车外形而开发。数学基础简单,容易实现设计汽车外形而开发。数学基础简单,容易实现n Bzier样条在各种样条在各种CAD系统、大多数图形系统、系统、大多数图形系统、相关绘图和图形软件包中有广泛应用相关绘图和图形软件包中有广泛应用Bzier Curves定义n控制点控

2、制点:pk=(xk,yk,zk),k=0,1,n.构造P(u)nBk,n(u)是Bernstein(伯恩斯坦)函数:nC(n,k)是二项式系数n:nPrescribed:00=1,0!=1.Bernstein basis4nVector equation2024/4/22 周一交通运输学院CAD/CAM研究所5两点创建1次Bezier曲线nn=1,矩阵方程:nP0 到P1直线。2024/4/22 周一交通运输学院CAD/CAM研究所6The Two First Degree Blending Functions1次次Bernstein 函数函数2024/4/22 周一交通运输学院CAD/CAM

3、研究所7nWhen n=2,The matrix form is:nThis is a parabola(抛物线)starting at P0 and ending at P1.nAnd:3点创建2次Bezier曲线2024/4/22 周一交通运输学院CAD/CAM研究所8Blending Functions and the Curve Examples2次次Bernstein 函数函数2024/4/22 周一交通运输学院CAD/CAM研究所93次 Bzier CurvesnFour points can specifying a cubic Bzier curve.nP(t)=B0,3P0+

4、B1,3P1+B2,3 P2+B3,3P3=(1-t)3P0+3t(1-t)2P1+3t2(1-t)P2+t3P3(0 t 1)2024/4/22 周一交通运输学院CAD/CAM研究所103次 Bzier Curves矩阵表达式2024/4/22 周一交通运输学院CAD/CAM研究所11That is:代数形式nAs a rule,a Bzier Curve is a polynomial of degree one less than the number of control points used:n two points generate a straight line,n three

5、 points generate a parabola,n four points a cubic curve,and so forth.UkUn-k2024/4/22 周一交通运输学院CAD/CAM研究所13已知Bezier曲线特征多边形的顶点P0(1,2)、P1(3,4)、P2(5,6)、P3(7,8),求Bezier曲线的参数方程P(t)(矩阵表示);计算 t=0.5,曲线上点P(0.5)重要重要试从Bzier曲线的定义式写出三次Bzier曲线的矩阵表示。(本题15分,只写出结果者得2分)UkUn-k2024/4/22 周一交通运输学院CAD/CAM研究所14Examples prog8

6、BezierCurve.exe2024/4/22 周一交通运输学院CAD/CAM研究所15Bzier Curves的性质1.Endpoint Interpolation(端点插值)2.Affine Invariance(仿射不变性)3.Convex-hull Property(凸包性)4.Linear Precision(线性)5.Variation-diminishing Property(变差缩减性)6.Derivativesof Bzier Curves(导数)掌握掌握2024/4/22 周一交通运输学院CAD/CAM研究所16端点插值Endpoint InterpolationnA B

7、zier Curve dose not generally pass through,or interpolate,all of the control points,but it always interpolates the first and the last point.2024/4/22 周一交通运输学院CAD/CAM研究所17P0P3P2P1Q0Q3Q1Q2Affine Invariance(仿射不变性)2024/4/22 周一交通运输学院CAD/CAM研究所18Convex-hull Property(凸包性)nA Bzier Curve never wanders outsid

8、e its convex hull.2024/4/22 周一交通运输学院CAD/CAM研究所19Linear Precision(线性)nIf all of the control points are placed in a straight line,their convex hull collapses(压缩)to a line.The Bzier Curve is therefore“trapped”inside this hull and so must also be a straight line.2024/4/22 周一交通运输学院CAD/CAM研究所20Variation-d

9、iminishing Property(变差缩减性)2024/4/22 周一交通运输学院CAD/CAM研究所21Derivatives of Bzier Curves导数nThe first derivative of a Bzier Curve isnSo the velocity(the first derivative)is another Bzier Curve,built on a new set of control vectors pk.2024/4/22 周一交通运输学院CAD/CAM研究所22nWhen t=0,t=1,one can evaluate the derivat

10、ives at the starting point and the ending point:nThus,the slope at the beginning of the curve is along the line joining the first two control points,and the slope at the end is along the line joining the last two endpoints.2024/4/22 周一交通运输学院CAD/CAM研究所23n因此,曲线在起点处的切线方向是第一第二控制点的连线,长度是其n倍;曲线在终点处的切线方向是倒

11、数第二第一控制点的连线,长度是其n倍。n端点的二阶导数取决于与其最靠近的三个控制点,与其他点无关。n事实上,r阶导矢只与(r+1)个相邻点有关,与更远点无关。2024/4/22 周一交通运输学院CAD/CAM研究所24使用Bzier Curves设计nClosed Bzier curve(封闭)nTo pass closer to a given point(靠近曲线)nPiecing lower degree Bzier curve sections (Bezier曲线拼接)2024/4/22 周一交通运输学院CAD/CAM研究所25Closed Bzier curve2024/4/22 周

12、一交通运输学院CAD/CAM研究所26To Pass Closer to Given Point2024/4/22 周一交通运输学院CAD/CAM研究所27Bezier曲线拼接nG0:Pn=Q0;(ai=Pi-Pi-1 bj=Qj-Qj-1)nG1:b1=an,that is,Pn-1,Pn=Q0,Q1are collinear.nC1:b1=an,that is,Pn=Q0 and Q1=Pn+(Pn-Pn-1).nC2:based on C1,and Q2=Pn-2+4(Pn-Pn-1).2024/4/22 周一交通运输学院CAD/CAM研究所28Chapter 8 Three-Dimen

13、sional Object Representations贝塞尔曲面(Bzier Surfaces)2024/4/22 周一交通运输学院CAD/CAM研究所29n张量积Bezier曲面定义With pj,k specifying the location of the(m+1)by(n+1)control points.2024/4/22 周一交通运输学院CAD/CAM研究所30Matrix Form2024/4/22 周一交通运输学院CAD/CAM研究所31Example Bzier Surface constructed for m=2,n=2.prog8Beziersurf.exe202

14、4/4/22 周一交通运输学院CAD/CAM研究所32Bzier Surfaces Have the Same Properties as Bzier Curves.Double cubic Bzier surface patch and its boundary10P20P01P11P21P31P02P22P12P32P13P23P00)0,0(PP=30)0,1(PP=03)1,0(PP=33)1,1(PP=)0,(uP)1,(uP),0(vP),1(vP2024/4/22 周一交通运输学院CAD/CAM研究所33用Open GL画Bezier曲线1.Bezier曲线由以下函数定义:voi

15、d glMap1fd(GLenum target,TYPEu1,TYPEu2,GLint stride,GLint order,const TYPE*points);nGLenum target,枚举型变量,指定控制点维数:GL_MAP1_VERTEX_3、GL_MAP1_VERTEX_4。nTYPEu1、TYPEu2,指定参数的最小、最大值。nconst TYPE*points,指向控制点数组的指针。nGLint stride,指出在数组const TYPE*points中,从一个控制点到下一个控制点之间的数据个数(位移量)。nGLint order,控制点个数,即Bezier曲线的阶数,多

16、项式次数+1。2024/4/22 周一交通运输学院CAD/CAM研究所342.定义了Bezier曲线后,进行计算之前,需用target的值为参数调用glEnable()激活(glDisable()取消)。3.用以下函数计算曲线上的点:void glEvalCoord1fdv(TYPE u);nTYPE u的取值在TYPEu1、TYPEu2之内。n该函数会将参数规范化。n例子:n源代码n运行2024/4/22 周一交通运输学院CAD/CAM研究所35n定义并激活贝塞尔曲线后,亦可用定义网格(Grid,均匀间隔坐标)的方式在参数区间均匀取值计算曲线上点的坐标。n定义一维网格:void glMapG

17、rid1fd(GLint n,TYPEu1,TYPEu2);nGLint n,参数的均匀分割数。n一维求值并绘制曲线:void glEvalMesh1(GLenum mode,GLint p1,GLint p2);nGLenum mode,取值GL_POINT或GL_LINE,画点或划线。nGLint p1、GLint p2,参数的对应范围。2024/4/22 周一交通运输学院CAD/CAM研究所36用Open GL画Bezier曲面1.Bezier曲面由以下函数定义:void glMap2fd(GLenum target,TYPEu1,TYPEu2,GLint ustride,GLint u

18、order,TYPEv1,TYPEv2,GLint vstride,GLint vorder,TYPE*points);nGLenum target,枚举型变量,指定控制点维数:GL_MAP1_VERTEX_3、GL_MAP1_VERTEX_4。nTYPEu1、TYPEu2,TYPEv1、TYPEv2指定参数u和v的最小、最大值。nconst TYPE*points,指向控制点数组的指针。nGLint ustride、GLint vstride,分别指出在数组const TYPE*points中,从一个控制点到下一个控制点之间的数据个数(位移量)。nGLint uorder、GLint vor

19、der,分别指出两个方向的控制点个数,即其各自的阶数,多项式次数+1。2024/4/22 周一交通运输学院CAD/CAM研究所372.定义了Bezier曲面后,进行计算之前,需用target的值为参数调用glEnable()激活(glDisable()取消)。3.用以下函数计算曲面上的点:void glEvalCoord2fdv(TYPE u,TYPE v);nTYPE u、TYPE v的取值分别在TYPEu1、TYPEu2和TYPEv1,TYPEv2之内。n该函数会将参数规范化。n例子:n源代码n运行2024/4/22 周一交通运输学院CAD/CAM研究所38n定义并激活贝塞尔曲面后,亦可通

20、过定义网格(Grid,均匀间隔坐标)的方式在参数区间均匀取值计算曲面上点的坐标。n定义二维网格:void glMapGrid2fd(GLint nu,TYPEu1,TYPEu2,GLint nv,TYPEv1,TYPEv2);nGLint nu、GLint nv,参数的均匀分割数。n二维求值并绘制曲面:void glEvalMesh2(GLenum mode,GLint p1,GLint p2,GLint q2,GLint q2);nGLenum mode,取值GL_POINT或GL_LINE,画点或划线。nGLint p1、GLint p2和GLint q2、GLint q2是参数的对应范围。n例子n代码n运行附录1:知识扩展nBernstein 函数递归计算函数递归计算2024/4/22 周一交通运输学院CAD/CAM研究所392024/4/22 周一交通运输学院CAD/CAM研究所40Bernstein 函数递归计算函数递归计算附录1:知识扩展Bezier曲线的曲线的DeCasteljau递归递归计算计算2024/4/22 周一交通运输学院CAD/CAM研究所42 已知Bezier曲线特征多边形的顶点P0(1,2)、P1(3,4)、P2(5,6)、P3(7,8),求Bezier曲线的参数方程P(t)上t=0.5点

展开阅读全文
相似文档                                   自信AI助手自信AI助手
猜你喜欢                                   自信AI导航自信AI导航
搜索标签

当前位置:首页 > 考试专区 > 中考

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        获赠5币

©2010-2024 宁波自信网络信息技术有限公司  版权所有

客服电话:4008-655-100  投诉/维权电话:4009-655-100

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :gzh.png    weibo.png    LOFTER.png 

客服