计算机图形学--第4章建模的数学基础(自学).ppt_第1页
计算机图形学--第4章建模的数学基础(自学).ppt_第2页
计算机图形学--第4章建模的数学基础(自学).ppt_第3页
计算机图形学--第4章建模的数学基础(自学).ppt_第4页
计算机图形学--第4章建模的数学基础(自学).ppt_第5页
已阅读5页,还剩27页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College PowerPoint Instructors Resource 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. Mathematics for Modeling Some mathematics tools to help you develop your graphics programs Mathematics is an Important Tool for Computer Graphics In this chapter we survey a number of topics that are each helpful in one or more places in graphics The presentation here may not be as deep as you would like, but you can consult mathematics textbooks for more The order is generally simpler to more complex, but is not systematic What Is a 2D or 3D Space? We use 2D and 3D Euclidean space Our points are (x,y) or (x,y,z) They correspond to points in 2D or 3D space with X-Y or X-Y-Z coordinates We generally use right-hand coordinates (right) rather than left-hand ones (left) Points Geometrically, a point is a position in space Algebraically, the point is defined by its coordinates (x,y) or (x,y,z) We will usually see points as vertices in a geometric object However, a triple (x,y,z) or a quadruple (x,y,z,w) will sometimes have another meaning, such as a color Lines Lines are one-dimensional objects that are associated with a point and a direction vector The line through a given point P0 in a given direction contains all points P so that the direction from P to P0 is a scalar multiple of the direction vector If you have two points, the vector from one to the other can be the lines vector Lines (2) If you have two points P0 and P1, the line containing them can be expressed by for all possible real values of t; this is called the parameter for the line This equation is about points, but you can easily turn this into equations about each component separately Rays A ray is defined very much like a line, but only points that lie in the same direction as the lines vector are included. This is given by the equation of the line except that we only allow values of the parameter t 0. Line Segments A line segment is a portion of a line that is given by parameters t in 0,1 With the two-point approach, the line segment contains all the points between P0 and P1 When you define two adjacent vertices of a graphics object, the edge between them is a line segment Line Segments (2) Often the parameter for a line segment will be very important, so we need to understand how parameters match their corresponding points Parametric Curves A parametric curve is defined by three functions of one parameter x(t), y(t), z(t) For any value of t, the point (x(t), y(t), z(t) is on the curve We will see a number of parametric curves in our work The parameter is often limited to 0,1 Parametric Surfaces A parametric surface is defined by three functions of two parameters x(s,t), y(s,t), z(s,t) For any values of the parameters (s, t), the point (x(s,t),y(s,t),z(s,t) is on the curve We will see even more parametric surfaces in our work The parameters are often limited to 0,1 Vectors Vectors are much like points and are given by tuples of real numbers Geometrically, vectors represent directions rather than positions Vectors have length, given by A unit vector has length 1 Vector Operations Vectors have four primary operations Addition (componentwise) Scalar multiplication Dot product Cross product Dot Product This operation takes two vectors and returns a scalar Operates by adding the componentwise products There are geometric meanings to the dot product Dot Product (2) Geometrically, the dot product depends on the angle between the vectors For any two vectors A and B, if theta is the angle between the vectors, If two vectors have a dot product of zero, they are orthogonal (perpendicular to each other) Dot Product (3) The dot product is very helpful when you consider the relationship between two vectors The length of the projection of a vector U onto a vector V is given by Cross Product The cross product of two vectors yields another vector This vector is perpendicular to both of the original vectors The computation is given by a determinant calculation, but more simply: Cross Product (2) Cross products are not commutative: Cross products are very handy when you want to compute a vector normal to two given vectors (e.g. vertex normals) Reflection Vectors If you have a normal vector at a point and an incoming vector (e.g. a light vector), you may need to compute the reflection of the incoming vector This is given by Transformations When we talked about modeling transformations, we focused on what they do rather than on how they are done If we talk about the mathematics, however, we must talk about how they work Transformations (2) Transformations include scaling, translation, rotation Geometry is processed as 4-tuples (x,y,z,w) and all transformations are linear Thus transformations act as 4x4 matrices Transformations (3) Scaling matrix Translation matrix Transformations (4) Rotations are more complex, and we usually think of them only in terms of rotations around coordinate axes For the 2D case: the x-axis rotation R Transformations (5) Rotations by around each axis: around X around Y around Z The Y case is different because of the axis order Planes A plane can be defined several ways A plane is determined by three points Given a point P and a line L through P, a plane is the set of points X so that the line XP is perpendicular to L These are the same: the three points determine two lines, and the cross product of the lines determines the normal line Planes (2) Equation of a plane can be derived from the second definition Or, working through this equation and collecting terms, we end up with Here the coefficients A, B, C are the components of the normal vector Convex Polygons A polygon is complex if for any two points A and B in the polygon, the line between them is all in the polygon Alternately, a convex polygon is the convex

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论