计算机图形学多边形填充代码_计算机图形学 Computer Graphics (第一周笔记及课件翻译)...

1967eff38f1516df889a1735cff1b166.png

本文使用 Zhihu On VSCode 创作并发布

注:本文部分内容源自于UDE课程 Computer Graphics(Prof. Dr. Jens Krüger),仅供本人自己学习与作为课程笔记使用。(所有引用都已标注原网址,见文章或附录。若存在版权侵犯,请联系本人删除侵权内容。)

Ps:若需要课程原ppt请联系我。再次声明,所有文档不可作为商业用途,仅供学习使用。谢谢!

1. 第一章 简介 Introduction

1.1 教授推荐的书(UDE 图书馆可以借阅到)

  1. Foley, Van Dam, Feiner, Hughes ... Computer Graphics: Principles and Practice, Addison-Wesley

  2. Watt & Watt Computer Graphics, Addison-Wesley

  3. Glassner Principles of digital image synthesis, Morgan Kaufman

1.2 从几个方面简单了解一下CG

  1. 渲染(Rendering):是指在计算机上展示模型和场景。The display of models and scenes on a computer.

    8f079811da41ca14f948c2c1a9df8fe0.png
  2. 动画与仿真(Animation & Simulation):指在计算机上动态图像的生成和表示。The generation and representation of dynamic imagery on a computer.

    eb65335047658fe9b666bff0d250b0c7.png
    Animation & Simulation
  3. 影像与计算机视觉(Imaging & Computer Vision):对图像的处理和从图像中提取特定对象的信息。The manipulation of images and the extraction of object specific information from images.

    6cf20f1482b56115d14698b47acfba9b.png
  • Ps:在课程视频中教授提到了 CRV(Prof. Dr. Pauli) 这门课,这门课主要就是介绍这个方向的内容的。其实我已经通过了这门课的考试,但是等后期有时间了,我也会整理资料上传的。
  1. 建模(Modeling):几何形状在计算机上的有效表示和有效修改。The effective representation and efficient modification of geometric shape on a computer.

    eb8a35db66c44304810e12c1bfba012a.png
  2. 可视化(Visualization):在大规模多维和/或多模态数据集中可视化地表示信息内容的方法。Methods to visually represent the information content within large-scale multi-dimensional and/or multimodality data sets.

    b5d9bca82f34e76e83648b2c05e1f93b.png

1.3 逼真的图像合成 Photorealistic image synthesis

  • 图像合成算法,即渲染算法(Algorithms for image synthesis, i.e. rendering algorithms)
    • 通过给定一个数字模型来生成这个模型所描述的真实图像。Given a digital model on the computer, what has to be done to generate a realistic image of this model.

    • 一个足够逼真的图像与真实物体的照片我们通常没有办法将它们区分开了,下面的这张图片就是使用CG生成的。A realistic image is one that cannot be distinguished from a photograph of the real object.

      913a98725d90afbfd77ab676bc49c5e5.png

1.4 图像合成的成分和先决条件 Ingredients and prerequisites for image synthesis

  1. 第一步 基础 fundamentals:

    • 建模 Modeling
      • 多边形对象 Polygonal objects
    • 颜色 Color
    • 光线交互 Light interaction
      • 光照 Illumination
      • 反射,折射 Reflection, Refraction
  2. 第二步 光线追踪 ray-tracing:

    • 光线追踪 Ray-tracing
      • 技巧 Technique
      • 转换 Transformations
      • 照明/阴影 Lighting/Shading
      • 最优化 Optimization
      • 取样 Sampling
  3. 第三步 图形APIs graphics APIs:

    • 基于光栅化呈现 Rasterization based rendering
    • 渲染管道 Rendering pipeline
    • 投影变换 Projective transforms
    • 光栅化 Rasterization
    • 可编程性与GPUs Programmability and GPUs

234b8371e6e4412e9957e1f4995849fc.png

2. 第二章 几何模型1 Geometric Models 1

2.1 对象的表示 Object representation

  • 在计算机图形学中,我们经常在连续的对象上处理多边形近似。In computer graphics we often deal with polygonal approximations of continuous objects.

2.2 那么什么是多边形 What is a polygon?

  • 它由点组成,通常在3d空间 ℝ3。 It consists of points, typically in 3D-space ℝ3.

    • 一个点通过x、y、z坐标被表示出来;它被称为顶点。A point is represented by its x, y, z - coordinates; it is called a vertex.
  • 点通过线段(边)连接。Points are connected via line segments (edges).

    • 线段是根据其端点的顶点来指定的。Line segments are specified in terms of the vertices at their endpoints.
  • 多边形是一个平面封闭连通的一系列线段的内部。A polygon is the interior of a closed planar connected series of line segments.

  • 任意两条边不交叉,恰好两条边在每个顶点相交。The edges do not cross each other and exactly two edges meet at every vertex.

    67e3806663134d728357172b5ea58a54.png

2.3 多边形网格 Polygon mesh

  1. 那么什么是多边形网格 What is a polygon mesh?

    • 对象通常被认为是空心的。它们由一个由多边形(面)组成的封闭表面建模——边界表示或表面网格,即,对象建模为多面体。Objects are typically considered to be hollow. They are modelled by a closed surface composed of polygons (faces) – the boundary representation or surface mesh i.e., objects are modelled as polyhedra..
  2. 多边形网格的类型 Types of polygon meshes

    • 三角形网格和四边形网格。Triangle meshes and quad meshes.
  3. 无效的网格 Invalid Meshes

    • 带孔的三角剖分 holes

      8fdb32f82137faf94a595b98abd4704b.png
    • 具有重叠面的三角剖分 overlapping face

      cf245ccc82a5821d8bbbd34f5e42d2cc.png
    • 带有T形顶点的三角剖分 T-Vertices

      ca8fe76e20804d40173be1705ea07b36.png
  4. 我们只考虑流形网格 Manifold meshes

    • 这种网格,其中除边界边外,每条边都必须由恰好两个面共享。A mesh where every edge must be shared by exactly 2 faces, except the border edges.
  5. 我们只考虑可定向的曲面 Orientable surfaces

    • 这样的曲面,法线可以一致地排列,例如全部指向外。Normals can be ordered consistently, e.g. pointing outwards.

    Ps:不可定向的曲面典型的2个案例就是:莫比乌斯带 (Möbius strip) 与 克莱因瓶 (Klein bottle)

2.4 网格图 Meshes as Graphs

- 图是一个2-tupel <V,E>
    - V:节点的集合 *V: the set of nodes.*
    - E:连接两个节点的边的集合 *E: the set of edges connecting two nodes.*
  1. 平面性 Planarity

    • 一个平面图 A planar graph
      • 其顶点和边可以在ℝ2中嵌入以使其边不相交的图 Graph whose vertices and edges can be embedded in ℝ2 such that its edges do not intersect.
    • 一个平面图形 A plane graph
      • 在平面上画的平面图 A planar graph drawn in a plane.
  2. 连接 Connected

    • 连通平面图为2-tupel <V,E>
      • V:节点的集合 V: the set of nodes.
      • E:连接两个节点的边的集合 E: the set of edges connecting two nodes.
      • 所有节点都通过一条路径沿边缘连接起来 All nodes are connected via a path along the edge.
      • F:面是平面的连接部分,是沿平面边缘切割平面时产生的 F: the faces are the connected parts of the plane, which emerge when cutting the plane along the edges
      • 三角化:每个面都是三角形的图形。Triangulation: graph where every face is a triangle.
  3. 欧拉公式(用于连通平面图) Euler‘s Formula (for connected planar graphs)

    • V − E + F = 2

      Proof

    • 每个凸多面体都可以转化为连通的平面图,即欧拉公式也成立 Every convex polyhedron can be turned into a connected planar graph i.e., Euler’s Formula holds as well.

  4. 多边形网格 Polygon meshes

    • 一个顶点的n环是指存在一条路径到达该顶点的长度为n的顶点集合 n-ring of a vertex is the set of vertices for which a path to that vertex of length n exist.

    • 顶点的价等于相邻边的数量(=相邻顶点的数量) Valence of a vertex is the number of adjacent edges (= number of adjacent vertices).

  5. 图的理论问题 Graph theoretical problems

    • 从一个顶点到另一个顶点的最短路径? Shortest path along edges from one vertex to another?

    • 是否存在一条路径,每个顶点只被访问一次? Does a path exist along which every vertex is visited exactly once?

    • 一个由V个顶点组成的三角形网格可以有多少条边? How many edges E can a triangle mesh of V vertices have?

      • E ≤ 3V – 6, 3F = 2E (E ≈ 3V, F ≈ 2V)
    • 三角形网格中顶点的平均价是多少? What is the average valence of the vertices in a triangle mesh ?

      • < 6 (< 4 in a mesh of quadrilaterals)
    • 哪个三角形网格可以是6规则的(所有的顶点都有价6)? Which triangle meshes can be 6-regular (all vertices have valence 6)?

2.5 多面体的属 Genus of a polyhedron

  • 属:不断开图形到多个部件的闭合切割曲线的最大数目,即“孔”或“柄”的数目。Genus: Maximal number of closed cutting curves that do not disconnect the graph into multiple components, i.e., the number of "holes" or "handles".

    27be75829f58a824db216700594abd6d.png

2.6 Euler-Poincare 公式 Euler-Poincare Formula

  • 对于一个g属的闭多边形网格,给出了顶点数V、边数E、面数F的关系 For a closed polygonal mesh of genus g, the relation of the number V of vertices, E of edges, and F of faces is given.

  • V - E + F = 2(1-g)

    Proof

  • χ =(1-g) 被称为欧拉特性 The term χ = 2(1-g) is called the Euler characteristic.

    0dc20699653609edd2735e948ab81a80.png

    96981f42515fa4e9d20764f157ff8b8d.png

    1f494b1864f618e8befc54cc3fee3102.png

2.7 折线逼近 Polygonal approximation

  • 多边形近似是通过多边形网格对连续曲面的近似 。A polygonal approximation is an approximation of a continuous surface by a polygon mesh.

    e9c1e08ee17c22f14cb9f609895baaa1.png
  • 多边形近似通常由连续曲面上的一组离散点组成,这些点通过边连接。A polygonal approximation typically consists of a discrete set of points of the continuous surface, which are connected via edges.

    6823b8c3003d2078b310623b8eabcff9.png
  • 构造给定点集的连通性(边)称为三角剖分 Constructing the connectivity (edges) for a given set of points is called triangulation

    0644ad0dc95e017d41c560c7499ce061.png

    随着插补点个数的增加,误差呈二次递减;误差随着间隔平方的大小而减小

2.8 自适应网格 Adaptive Meshes

  • 多边形近似通常是自适应的,即在高曲率区域使用更多/更小的多边形 Polygonal approximation are typically adaptive, i.e., more/smaller polygons are used in regions of high curvature.

    d2cd170bf952ad82f3e7a869382a325c.png

2.9 三角形网格表示 Triangle mesh representation

  • 几何:顶点的位置 Geometry: where are the vertices positioned.

  • (多边形)拓扑:顶点是如何连接的 (Polygon-)topology: how are the vertices connected .

  • (网格-)拓扑:多边形是如何连接的 (Mesh-)topology: how are the polygons connected.

  • 显式表示(STL文件):为n个三角形n·3·3 = 9n个浮点数中的每个存储3个顶点 Explicit representation (STL files): store three vertices for each of the n triangles n·3·3 = 9n floats.

    2e90ce5044e6366f184b78962ad865d3.png

2.10 共享顶点表示 Shared vertex representation

  • 又名“索引脸集”表示(OBJ文件) aka „indexed face set“ representation (OBJ, OFF files).

  • 所有顶点的坐标数组(3n个浮点数) Array of coordinates of all vertices (3n floats).

  • 顶点列表中带索引的三角形数组(3n个整数) Array of triangles with indices into the vertex list (3n integers).

    c11d1d0b5c4cf9efeac9a198ba7e3599.png

    12 B/V & 12 B/F ➔ 36 B/V

2.11 索引面集表示属性 Indexed face set representation properties

  • 冗余比显式表示少 Less redundancy than explicit representation.

  • 分离几何和(多边形)拓扑更有效的计算表面 Separation of geometry and (polygon-)topology more efficient computations on surfaces.

  • 网格操作仍然很难实现,例如找到所有1环邻居 Mesh operators still difficult to realise e.g. find all 1-ring neighbours.

2.12 扩展共享顶点表示 Extended shared vertex representation

  • 顶点数组,每个都引用一个相邻的三角形:3n个浮点数+ 1n个整数 Array of vertices, each with a reference to one adjacent triangle: 3n floats + 1n integers.

  • 三角形数组,每个数组都有对相邻三角形的引用(边界:-1):6n个整数 Array of triangles, each with a reference to adjacent triangles (at the border: -1): 6n integers.

    fadf3501f4ad3ab66845a65313eae266.png

    16 B/V + 24 B/F ➔ 64 B/V

2.13 翼边数据结构 Winged Edge data structure

  • 顶点数组:位置,引用1条边 Arrays of Vertices: position, reference to 1 edge.

  • 边数组:引用2个顶点,2个面,4条边 Arrays of Edges: references to 2 vertices, 2 faces, 4 edges.

  • 面数组:引用1条边 Arrays of Faces: reference to 1 edge.

    f1fee99b5723c3a08cc93d1f3e66c98b.png

    120 B/V

c855c690662f5d851f68d048f0788a21.png

2.14 例子:找到给定顶点X的所有关联边。

Given vertex X;
Retrieve incident edge e of X from vertex table;
Let s be e; // working variable
do // move to next edge
 Output s; // incident edge
 if start vertex of s is equal to X then
 s = the successor of the left face of s
 else
 s = the successor of the right face of s;
 end if
while s ≠ e; // loop back if not eq

第一周 End

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
智慧校园整体解决方案是响应国家教育信息化政策,结合教育改革和技术创新的产物。该方案以物联网、大数据、人工智能和移动互联技术为基础,旨在打造一个安全、高效、互动且环保的教育环境。方案强调从数字化校园向智慧校园的转变,通过自动数据采集、智能分析和按需服务,实现校园业务的智能化管理。 方案的总体设计原则包括应用至上、分层设计和互联互通,确保系统能够满足不同用户角色的需求,并实现数据和资源的整合与共享。框架设计涵盖了校园安全、管理、教学、环境等多个方面,构建了一个全面的校园应用生态系统。这包括智慧安全系统、校园身份识别、智能排课及选课系统、智慧学习系统、精品录播教室方案等,以支持个性化学习和教学评估。 建设内容突出了智慧安全和智慧管理的重要性。智慧安全管理通过分布式录播系统和紧急预案一键启动功能,增强校园安全预警和事件响应能力。智慧管理系统则利用物联网技术,实现人员和设备的智能管理,提高校园运营效率。 智慧教学部分,方案提供了智慧学习系统和精品录播教室方案,支持专业级学习硬件和智能化网络管理,促进个性化学习和教学资源的高效利用。同时,教学质量评估中心和资源应用平台的建设,旨在提升教学评估的科学性和教育资源的共享性。 智慧环境建设则侧重于基于物联网的设备管理,通过智慧教室管理系统实现教室环境的智能控制和能效管理,打造绿色、节能的校园环境。电子班牌和校园信息发布系统的建设,将作为智慧校园的核心和入口,提供教务、一卡通、图书馆等系统的集成信息。 总体而言,智慧校园整体解决方案通过集成先进技术,不仅提升了校园的信息化水平,而且优化了教学和管理流程,为学生、教师和家长提供了更加便捷、个性化的教育体验。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值