UC Davis Computer Graphics

Ref

Affine Transformation

vector space Alt text Alt text Alt text Alt text

Curves in plane

  • subdivision curve, Chaikin's Algorithm
    • control point 1/4 3/4 again and again go througn mid-pointAlt text
      • 反过来 Alt text pick some points tan line
    • 3d Alt text does not work
  • Bezier Curve attract point Alt text Alt text Alt text Alt text Alt text
  • B-spline curve Alt text continuous->derivative equal bezier vs spline 使用n = 3的贝塞尔曲线原因是要限定相邻的两个分段多项式,在交接点位置的一阶导数相等(斜率相等)和二阶导数相等(斜率的变化率相等)

move objects in space

  • a point in space Alt text
  • translation Alt text
  • scaling Alt text Alt text center is not in origin, then scaling will cause translation Alt text
  • rotate Alt text Alt text
  • 3d Alt text rotate around z axis Alt text

Rotations around an arbitrary axis

  • model-view-controller Alt text easy to debug
  • Rotate around rotate 一个点 一个向量(arbitrary axis)rotate some angles 怎么旋转:把这个点平移到原点,向量旋转到和eg. z axis重合,rotate some angles,再反着做回来 translation 投影 Alt text rotate -theta, rotate fi Alt text reverse Alt text
  • 4d Alt text projective point Alt text Alt text parabola 抛物线 project down as a circle rational splines 有理样条
  • simulate a camera Alt text

the camera transform

viewing transform

  • pinhole camera
    • camera point
    • direction vector / center of attention
    • up direction
    • angle of view
    • near and far distances Alt text 找到一种转换方式把3d的世界转换成视角的2d图像 pyramid -> cube(image space)-> square(screen space) Alt text (修正 image space 正负坐标反了) Alt text (修正+n, +f) Alt text Alt text Alt text (0, n*tan(a/2), -n)-> (1,1) image space Alt text Alt text
  • real world Alt text Alt text Alt text

Clipping

  • find the real interesting spaces - "in" Alt text Alt text Alt text Alt text ps. polygon convex, 连接任意两条边的线段都在区域内
    non-convex -> split into convex pieces
    
  • glu lookat vs glu perspective
    • glulookat
      void gluLookAt (
      GLdouble eyex,    GLdouble eyey,     GLdouble eyez, 
      GLdouble centerx,     GLdouble centery,     GLdouble centerz, 
      GLdouble upx,     GLdouble upy,     GLdouble upz);
      
      定义了观察者的做坐标,视野中心点在世界坐标系的位置 & 相机的朝向
      • glu perspective
        void gluPerspective (
        GLdouble fovy, 
        GLdouble aspect, 
        GLdouble zNear, 
        GLdouble zFar);
        
        定义了相机的内在参数,可视角大小, 物体显示在canvas上的x和y方向上的比例,第三个参数zNear,定义距离相机(人眼)最近处物体截面相距的距离。这个值越大,表示观测点距离物体距离越远,看起来物体就比较小,反之则比较大。如果物体运动到距离观测点的距离小于了设定的zNear,则物体不会被绘制在画板上。 第四个参数zFar,定义可观测到的物体的最远处截面相距相机的距离。如果物体运动到距离观测点的距离大于了设定的zFar,则物体不会被绘制的画板上。
  • do clipping in image space Alt text

Depth Buffers and Ray Tracing

?something is in front of another image space judge by z coordinates

  • depth buffer 存储最近的物体的深度 Alt text 如果object的深度大于z buffer的值,不绘制
  • Ray Tracing Alt text
  • painter's algorithm 画家算法首先将场景中的多边形根据深度进行排序,然后按照顺序进行描绘

Color and Shading

  • color Alt text
  • lights
    • background light (ambient light) is a constant
    • Lambert's Law Alt text
    • reflect Alt text base color Alt text n is glossness l input, v output h= l+v/2, h 和 n (法线) 夹角越小,反射的光越强

Quaternions

rotations structure data on disk? extension of complex Alt text Alt text Alt text 不满足交换律 Alt text

  • Unit quaternions Alt text rotate around vector v, rotate theta angle Alt text ps. 欧拉旋转: Gimbal Lock问题的核心还是在于我们采用了固定的旋转顺序 四元数: chrome-extension://cdonnmffkdaoajfknoeeecmchibpmkmg/assets/pdf/web/viewer.html?file=https%3A%2F%2Fkrasjet.github.io%2Fquaternion%2Fquaternion.pdf

Shading and Texturing

  • shading 着色 Alt text b means base color -> texturing 10 hyper parameters direct light / spot light -> l change or not n bump mapping ploygons
    • flat shading (平面着色) one color
      • Gouraud Shading -> average color Alt text
    • phong shading -> average normal
  • texturing 纹理 texture mapping -> interpolate Alt text

The hierarchical modeling system

how to model things Alt text Alt text Alt text model one thing -> transform to another polygon -> commands not only drawing things -> but also building things

Scan Conversion

Alt text

  • device space Alt text split polygon into trapezoids Alt text edge track endpoint Alt text other staff: light sources <- inverse of viewing space texture coordinates R/G/B inks
  • Warnock's algorithm

Curves and surfaces

  • Chaikin's Algorithm Alt text Chaikin's Curve -> control points 1/4 3/4 (fix ratio), initial point may not on the curve 3d surface -> two pairs of control points -> subdivision algorithms
  • Bezier Patch
    • Bezier curve 1/2 initial point is on the curve
      • control points coplanar
      • convex hull property 凸包, curve is not getting away from u
      • variation diminishing 变差缩减性,不会来回摆动
      • slope at p0 is equal to p0p1, first derivative Alt text
      • how about second derivative Alt text
  • NURBS non uniform rational Bspline
    • NUBS Alt text limit degree of curves
  • Bezier surface four corners on the surface Bezier curves as boundary Alt text Alt text

Visible surface algorithm

Alt text

  • Painter's algorithm paint all from back to front <- sort polygons Alt text
    • Binary Tree Sort Alt text
      • BSP - trees Alt text moving camera position, just move subtree left to right
  • Warnock's algorithm Alt text

Ray Tracing

  • how it do eye position -> pixel trace to the nearest point Alt text Alt text
  • first paper Alt text
    reflect  shadow refract
    
  • forward & backward ray tracing backward ray tracing may miss things
  • calculate the nearest point Alt text

Subdivision Surface

  • Chaikin's Curve
  • Chaikin's Surface/Doo-Sabin Surface 不同方向上做1/4 3/4(Chaikin's points),连接,划分成一个个小的mesh Alt text Alt text Alt text
  • how to save such data ? -> split edge Alt text a pointer -> start point a pointer -> next edge a pointer -> neighbor subEdge
  • Catmull-Clark Subdivision loop subdivision (triangle meshes) Alt text vertex point (half way half way)& edge point (mid point) Alt text Alt text Face point: F = average of all points defining the face Edge point: E = average of tow adjoining face points and the two vertices Vertex point: V = (average of all face points + average of all edge poins + constant origin vectors )/ 4 Alt text Alt text
  • how to model sphere -> triangle Alt text Alt text data structure: 3 vertexes + 3 pointers to neighbors

Shadows part

  • ground plane (need a point and a normal) Alt text Alt text avoid sharp shadows -> texture with fuzzy edge polygons too complex -> general bounding box
  • shadow volumes Alt text count numbers of into a shadow volumes (+1) and out of a shadow volumes (-1) sum = zero : no shadows ps. umbra penumbra Alt text
  • depth buffer shadows
    • for each light source, create a "picture" (image space, z buffer)
    • for each eye point, create a "picture" (z buffer)
    • reconcile these pictures Alt text Alt text Alt text

Camera motion

  • simulate camera motion path as smooth curve
    • Lagrange interpolation spline
    • Ferguson curve Alt text Alt text
    • Catmull Alt text 二次导等于间隔点连线 c1 连续 curve
    • ps Alt text

Branches of CG

Alt text Alt text

Copyright © tingxia.top 2021 all right reserved,powered by Gitbook该文件修订时间: 2022-02-28 11:12:04

results matching ""

    No results matching ""