【计算机图形学】习题课:Viewing

【计算机图形学】Viewing 部分问题与解答

  • CS100433 Computer Graphics Assignment 2
    • 1 Proof the composed transformations defined in global coordinate frame is equivalent to the composed transformations defined in local coordinate frame but in different composing order.
    • 2 Describe the differences between orthographic and perspective 3D viewing processes? (Draw the view volume of the above two viewings)
    • 3 Which one defines the default NDC? Why?
    • 4 What is the difference between the clip space and NDC?
    • 5 Why does clipping performed in the clip space?
    • 6 What is the cause of Z-fighting? And can we solve the Z-fighting?

如果这篇文章对你有帮助,欢迎点赞与收藏~

CS100433 Computer Graphics Assignment 2

1 Proof the composed transformations defined in global coordinate frame is equivalent to the composed transformations defined in local coordinate frame but in different composing order.

  1. Global (or World) Frame Transformations: Transformations are applied relative to a fixed global/world coordinate frame. When multiple transformations are applied, they are composed in the same order that they are applied to the point or object.
  2. Local (or Body or Object) Frame Transformations: Transformations are applied relative to the object’s own local coordinate frame. As the object moves, its local frame moves with it. When multiple transformations are applied, the order of composition is typically reversed because each subsequent transformation is applied in the new local frame created by the previous transformation.

2 Describe the differences between orthographic and perspective 3D viewing processes? (Draw the view volume of the above two viewings)

Orthographic Projection:

  • In orthographic projection, all projection lines are parallel. Objects are projected to the viewing plane at the same size, regardless of their distance from the viewer.
  • Orthographic projection does not exhibit perspective effects; that is, the size of objects on the viewing plane does not change with distance. Objects far away appear the same size as those that are near.
  • The view volume for orthographic projection is a rectangular box, often referred to as a “view frustum,” although in the case of orthographic projection, it’s technically a rectangular prism.
  • Orthographic projection is commonly used in engineering drawings and certain types of games (like 2D platformers), as it accurately reflects dimensions and angles without distortion.

Perspective Projection:

  • In perspective projection, projection lines radiate from a point (the viewer’s eye) and spread outward, causing objects that are further away to appear smaller, creating a sense of depth.
  • This type of projection mimics the way the human eye observes the world, with closer objects appearing larger and distant objects appearing smaller.
  • The view volume for perspective projection is a truncated pyramid, with the apex at the viewer’s eye and the base corresponding to the far clipping plane.
  • Perspective projection is used in most 3D games and simulation environments because it provides a more natural three-dimensional appearance.

在这里插入图片描述

在这里插入图片描述

3 Which one defines the default NDC? Why?

glm::ortho(-1., 1., -1., 1., -1., 1.)
glm::ortho(-1., 1., -1., 1., 1., -1.)

Between glm::ortho(-1., 1., -1., 1., -1., 1.) and glm::ortho(-1., 1., -1., 1., 1., -1.), the latter defines the default NDC in OpenGL. This is because the NDC in OpenGL follows a left-hand coordinate frame where the positive Z-axis points out of the screen. The parameters for zNear and zFar in the glm::ortho function represent distances measured in the direction of the camera. So, in the latter function, with zNear set to 1 and zFar set to -1, it signifies that the near clipping plane is closer to the camera while the far clipping plane is farther away, consistent with the default behavior of OpenGL’s NDC.

在这里插入图片描述

4 What is the difference between the clip space and NDC?

Clip Space:

  • Clip space is encountered after the projection transformation has been applied to the vertices of objects in the scene but before the perspective division.
  • It is a four-dimensional space because it includes the homogeneous coordinate w alongside the usual x, y, and z coordinates. The value of w is not necessarily 1; it could be any value depending on the depth and the type of projection used (orthographic or perspective).
  • In clip space, the graphics system can perform clipping to discard geometry that is outside the viewer’s field of view or behind the camera. This is because the clip space is configured in such a way that any coordinates outside a certain range can be easily identified and excluded from the final image.

Normalized Device Coordinates (NDC):

  • After the vertices have been transformed to clip space and clipping has been performed, the perspective division is applied. This process involves dividing the x, y, and z coordinates by the w coordinate. The result of this division is the NDC space.
  • In NDC, the homogeneous coordinate w is now equal to 1. This effectively reduces the dimensionality back to three, making it suitable for the final step of rasterization, which maps these coordinates onto the two-dimensional viewport or screen.
  • The NDC space is a cubic volume where the x, y, and z coordinates range from -1 to 1. Any point within this range can be mapped directly to the viewport.

5 Why does clipping performed in the clip space?

  1. Efficiency: Clip space is a standardized and regular space, which makes it easier and more efficient to determine if an object is within the view frustum. Objects can be quickly tested against the boundaries of this space because, after projection but before the perspective division, the clip space is aligned with the view frustum. This means any coordinates that fall outside this regular volume can be efficiently identified and discarded.
  2. Correctness: In clip space, the original depth information of a vertex is preserved in the w component of its homogeneous coordinates. This is crucial because clipping decisions must be made based on accurate depth information to ensure that objects are correctly rendered in three dimensions. After perspective division, which converts clip space coordinates into normalized device coordinates (NDC), depth information is normalized. In NDC, all coordinates are compressed into a standard range (usually between -1 and 1), which is great for the next stages of rasterization but not for making depth-based clipping decisions.

6 What is the cause of Z-fighting? And can we solve the Z-fighting?

Z-fighting occurs due to the nonlinear interpolation of depth along the z-axis during normalization. Because the resolution of depth decreases for coordinates further from the nearest clipping plane, this can lead to precision issues in the depth buffer. When two surfaces are very close together and their depth values are nearly identical, the renderer might struggle to consistently determine which surface should be displayed over the other. This results in a flickering or stitching effect in the rendered image, known as Z-fighting.

To address the issue of Z-fighting, the following solutions can be implemented:

  1. Push the nearest clipping plane further away: By moving the nearest clipping plane backward as far as possible without significantly sacrificing the visible area, the density of depth buffer near the front can be reduced, which may alleviate the Z-fighting to some extent.
  2. Increase the precision of the Z-buffer: Using a depth buffer with more bits can increase the precision of depth values. For example, upgrading from a 16-bit to a 24-bit or 32-bit depth buffer can significantly reduce the occurrence of Z-fighting. This method increases the storage requirements and potential performance costs but can effectively mitigate the problem.

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/330480.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

rust跟我学五:是否安装双系统

图为RUST吉祥物 大家好,我是get_local_info作者带剑书生,这里用一篇文章讲解get_local_info是怎么得到检测双系统的。 首先,先要了解get_local_info是什么? get_local_info是一个获取linux系统信息的rust三方库,并提供一些常用功能,目前版本0.2.4。详细介绍地址:[我的Ru…

ubuntu opengl安装使用

文章目录 1.opengl的安装2.安装GLFW3.安装glad4.调用示例参考 1.opengl的安装 OpenGL到底是什么。一般它被认为是一个API(Application Programming Interface, 应用程序编程接口),包含了一系列可以操作图形、图像的函数。然而,OpenGL本身并不是一个API&…

Linux 系统之部署 h5ai 目录列表程序

一、h5ai 介绍 1.1)h5ai 简介 h5ai 是用于 HTTP Web 服务器的现代文件索引器,专注于您的文件。目录以吸引人的方式显示,浏览它们通过不同的视图、面包屑和树概述得到增强。最初 h5ai 是 HTML5 Apache Index 的首字母缩写,但现在它…

申请开启|成为亚马逊云科技 Community Builder,共建云端社区!

在探索由技术打造的云端世界时,和同行者一起学习,与技术专家共同探讨是开发者成长的最佳助力! 亚马逊云科技开发者社区 Community Builders 为技术爱好者和新兴思想领袖提供技术资源、学习和交流机会,帮助开发者探索、分享技术相关…

CMake+QT+大漠插件的桌面应用开发(QThread)

文章目录 CMakeQT大漠插件的桌面应用开发(QThread)简介环境项目结构配置编译环境代码 CMakeQT大漠插件的桌面应用开发(QThread) 简介 在CMakeQT大漠插件的桌面应用开发中已经给出了QT配合大漠插件开发桌面应用的样例 不过由于主…

macOS系统下载安装IDEA 操作流程

目录 第一步 进入官网,选择箭头指向的版本 第二步 下载完成后打开,拖动安装包安装​编辑 第三步 点击" project",在JDK下拉框选择"Download JDK" 第四步 下载完成以后,点击右下角的Create按钮。 第一步 进…

vscode开发java项目

安装java扩展 创建项目 vscode命令行面板搜索java命令行 出现如下提示 No build tools构建项目如下 java项目使用vscode单独打开文件夹(工作区中运行有问题),vscode中可直接点击右上角运行按钮执行 maven中spring boot项目 代码错误可以点…

jeecgboot 前端bug or 后端 看图

无法显示文本 只能显示value 很恶心 如果用 varchar 就可以 不知道有没有别的方式 用int 解决 ,可能是我没有发现好的方法

QT中操作word文档

QT中操作word文档: 参考如下内容: C(Qt) 和 Word、Excel、PDF 交互总结 Qt对word文档操作总结 QT中操作word文档 Qt/Windows桌面版提供了ActiveQt框架,用以为Qt和ActiveX提供完美结合。ActiveQt由两个模块组成: QAxContainer模…

【0到1的设计之路】计算机系统的状态机模型

Perface 在开始本文之前需要先介绍一下状态机的概念: 状态机不是实际机器设备,而是一个数学模型,通常体现为一个状态转换图。涉及到的相关概念是 State 状态,Event 事件,Action 动作,Transition 转换。状态…

[C++] opencv - Mat::convertTo函数介绍和使用场景

Mat::convertTo()函数 Converts an array to another data type with optional scaling. 该函数主要用于数据类型的相互转换。 The method converts source pixel values to the target data type. saturate_cast<> is applied at the end to avoid possible overf…

【论文阅读】One For All: Toward Training One Graph Model for All Classification Tasks

目录 0、基本信息1、研究动机2、创新点——One For All &#xff1a;unique features3、准备4、具体实现4.1、用TAGs统一来自不同领域的图数据4.2、用NOI&#xff08;NODES-OF-INTEREST&#xff09;统一不同图任务4.2.1、NOI子图4.2.2、NOI提示结点 4.3、用于图的上下文学习&am…

(2023版)斯坦福CS231n学习笔记:DL与CV教程 (12) | 目标检测

前言 &#x1f4da; 笔记专栏&#xff1a;斯坦福CS231N&#xff1a;面向视觉识别的卷积神经网络&#xff08;23&#xff09;&#x1f517; 课程链接&#xff1a;https://www.bilibili.com/video/BV1xV411R7i5&#x1f4bb; CS231n: 深度学习计算机视觉&#xff08;2017&#xf…

2024华数杯国际赛AB题五小问完整思路+数据+四小问代码+后续高质量成品论文+运行结果高清图+参考文献

问题A&#xff1a;日本放射性废水 &#xff08;AB题的完整资料放在文末了&#xff09; 对于这次的华数杯A题&#xff0c;在我五月份完成的数维杯A题目中&#xff1a; 就已经完成过地下水污染物的公式推导&#xff1a; 因此&#xff0c;展示部分示例代码吧&#xff0c;我会在修…

Echarts柱状图 - 柱形颜色渐变

<!-- 违法 --> <template><div class"section"><div class"grid_body_top"><div v-for"(item, index) in topList" v-show"item.isShow" :key"index"><i :class"[icon, ...item.icon…

电子学会C/C++编程等级考试2023年12月(五级)真题解析

C/C++等级考试(1~8级)全部真题・点这里 第1题:书架(2023.12) John最近买了一个书架用来存放奶牛养殖书籍,但书架很快被存满了,只剩最顶层有空余。 John共有N头奶牛(1 ≤ N ≤ 20,000),每头奶牛有自己的高度Hi(1 ≤ Hi ≤ 10,000),N头奶牛的总高度为S。书架高度为B(1 …

Elasticsearch各种文档操作

本文来记录下Elasticsearch各种文档操作 文章目录 初始化文档数据查询所有文档匹配查询文档关键字精确查询文档多关键字精确查询文档字段匹配查询文档指定查询字段查询文档 初始化文档数据 在进行各种文档操作之前&#xff0c;我们先进行初始化文档数据的工作 查询所有文档 在 …

【React】Redux的使用详解

文章目录 Redux的三大原则Redux官方图react-redux使用 1、创建store管理全局状态​ 2、在项目index.js根节点引用 3、 在需要使用redux的页面或者组件中&#xff0c;通过connect高阶组件映射到该组件的props中 redux中异步操作如何使用redux-thunkcombineReducers函数 Re…

Pixels:重新定义游戏体验的区块链农场游戏

数据源&#xff1a;Pixels Dashboard 作者&#xff1a;lesleyfootprint.network 最近&#xff0c;Pixels 通过从 Polygon 转移到 Sky Mavis 旗下的 Ronin 网络&#xff0c;完成了一次战略性的转变。 Pixels 每日交易量 Pixels 在 Ronin 网络上的受欢迎程度急剧上升&#xf…

关于VScode的这个ssh的配置的经验

1.首先&#xff0c;我是因为重装了ubantu系统&#xff0c;不得不重新配置ssh 2.第一步&#xff0c;在本机的终端安装ssh插件&#xff1a; &#xff08;1&#xff09; &#xff08;2&#xff09;restart开启这个ssh端口 3.然后&#xff0c;就在vscode里面&#xff0c;安装哪个…