【计算机图形学】习题课: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.

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

1月14-17日为技术测试期!字节与腾讯上演“大和解”,抖音全面开放《王者荣耀》直播

综合整理|TesterHome社区 来源|《王者荣耀》官方、界面新闻 北京商报、IT之家 1月13日,腾讯游戏《王者荣耀》官方微博发布消息宣布,从1月21日起,《王者荣耀》抖音直播将全面开放。 为了筛查开播期间可能遇到的所有技…

几何_直线方程 Ax + By + C = 0 的系数A,B,C几何含义是?

参考: 直线方程 Ax By C 0 的系数A,B,C有什么几何含义?_设直线 l 的方程为axbyc0 怎么理解-CSDN博客 1. A B的含义:组成一个与直线垂直的向量 我们先来看A和B有什么含义。 在直线上取任意两点 P1:(x1…

OceanBase集群部署

我认为学习一个中间件比较好的方式是,先了解它的架构和运行原理,然后动手部署一遍,加深对它的了解,再使用它,最后进行总结和分享 本篇介绍OceanBase部署前提配置和集群部署 1.使用开源免费的社区版,企业版…

MetaGPT task1学习

基础知识学习了解: 安装环境: 获取MetaGPT 使用pip获取MetaGPT pip install -i https://pypi.tuna.tsinghua.edu.cn/simple metagpt0.5.2 配置MetaGPT 完成MetaGPT后,我们还需要完成一些配置才能开始使用这个强力的框架,包括配…

RHCE: web服务器+nfs服务器搭建

网站需求: 1.基于域名[www.openlab.com](http://www.openlab.com)可以访问网站内容为 welcome to openlab!!! web服务器准备工作: #添加多ip(也可以用nmtui命令在图形界面配置) [root192 ~]# nmcli connection modify ens32 ipv4.method manual ipv4.…

[面试题~] Golang

1. 逃逸分析 1.1 逃逸分析是什么? 在编译原理中,分析指针动态范围的方法称之为逃逸分析。在Go中的表现是,如果一个对象的指针被多个方法或线程引用时,则称这个指针发生了逃逸。 所以,我认为逃逸分析指的是&#xff0…

[leetcode~数位动态规划] 2719. 统计整数数目 hard

给你两个数字字符串 num1 和 num2 &#xff0c;以及两个整数 max_sum 和 min_sum 。如果一个整数 x 满足以下条件&#xff0c;我们称它是一个好整数&#xff1a; num1 < x < num2 min_sum < digit_sum(x) < max_sum. 请你返回好整数的数目。答案可能很大&#xff…

极客时间-《左耳听风》文章笔记 + 个人思考

极客时间-《左耳听风》文章笔记 个人思考 分布式架构21 | 分布式系统架构的冰与火 分布式架构 21 | 分布式系统架构的冰与火 比较流行的高并发框架&#xff1a; Node.js&#xff1a;是一个基于Chrome V8引擎的JavaScript运行环境&#xff0c;它使用事件驱动、非阻塞I/O模型…

2024.1.17

今天我已经回家了&#xff0c;感觉家就像我的温柔乡一样&#xff0c;一到了家&#xff0c;就不想学习了&#xff0c;这是很不对的事情&#xff0c;不该如此堕落&#xff0c;还是要像在学校一样该干什么干什么&#xff0c;所以说还是复习和写了一下曾经写过的代码。 #define _C…

[Android] Android架构体系(1)

文章目录 Android 的框架Dalvik 虚拟机JNI原生二进制可执行文件Android NDK中的binutils Bionic谷歌考虑到的版权问题Bionic与传统的C标准库&#xff08;如glibc&#xff09;的一些不同 参考 Android 的框架 Android 取得成功的关键因素之一就是它丰富的框架集。 没有这些框架…

第2章 法律法规

文章目录 2.1.1 《电信条例》概述2.1.2 《电信条例》关于电信市场的规定1、电信业务许可规定2、电信资费规定3、电信资费规定 2.1.3《电信条例》关于电信服务的规定1、电信业务经营者的义务2、电信用户的相关义务3、电信用户申诉及受理的规定4、电信业务经营者不正当行为的规定…

架构08- 理解架构的模式2-管理和监控

大使模式&#xff1a;构建一个辅助服务&#xff0c;代表消费者使用服务或应用程序发送网络请求。 进程外的代理服务&#xff08;之前介绍中间件的时候也提到了&#xff0c;很多框架层面的事情可以以软件框架的形式寄宿在进程内&#xff0c;也可以以独立的代理形式做一个网络中…

AI绘图制作红包封面教程

注意&#xff1a;有不懂的话可加入QQ群聊一起交流&#xff1a;901944946欢迎大家关注微信公众号【程序猿代码之路】&#xff0c;每天都会不定时的发送一些红包封面&#xff01;&#xff01; 2024的春节即将到来&#xff0c;而在这春节到来之前&#xff0c;就有一个非常爆火的小…

黑马程序员 Java设计模式学习笔记(一)

目录 一、设计模式概述 1.1、23种设计模式有哪些&#xff1f; 1.2、软件设计模式的概念 1.3、学习设计模式的必要性 1.4、设计模式分类 二、UML图 2.1、类图概述 2.2、类图的作用 2.3、类图表示法 类的表示方式 类与类之间关系的表示方式 关联关系 聚合关系 组合…

陀螺仪LSM6DSV16X与AI集成(6)----检测自由落体

陀螺仪LSM6DSV16X与AI集成.6--检测自由落体 概述视频教学样品申请源码下载生成STM32CUBEMX串口配置IIC配置CS和SA0设置串口重定向参考程序初始换管脚获取ID复位操作BDU设置 概述 本文介绍如何初始化传感器并配置其参数&#xff0c;以便在检测到自由落体事件时发送通知。 最近…

【Python_PySide6学习笔记(二十九)】基于PySide6实现选项卡位于左侧的TabWidget控件,且文字方向为水平方向

基于PySide6实现选项卡位于左侧的TabWidget控件,且文字方向为水平方向 基于PySide6实现选项卡位于左侧的TabWidget控件,且文字方向为水平方向前言一、基于 QTabBar 实现 ctTabBar() 自定义选项卡1、重写获取索引处制表符大小函数 tabSizeHint()2、重写绘制事件 paintEvent()二…

显示报错: nmap.nmap.PortScannerError: ‘nmap program was not found in path‘

解决方案&#xff1a; 《关于想在Pycharm下使用nmap然后报错nmap.nmap.PortScannerError: ‘nmap program was not found in path.然后解决的那些事》 文章中进行了详尽的描述&#xff0c;总结一下就是下载一个nmap.exe&#xff0c;然后在nmap.py中引入nmap.exe所在的路径&…

基于长短期神经网络的回归分析,基于LSTM的回归预测

​目录 背影 摘要 LSTM的基本定义 LSTM实现的步骤 基于长短期神经网络LSTM的回归分析 MATALB代码:基于长短期神经网络的回归分析,基于LSTM的回归预测资源-CSDN文库 https://download.csdn.net/download/abc991835105/88184633 效果图 结果分析 展望 参考论文 背影 LSTM神经…

RabbitMQ常见问题之消息堆积

文章目录 一、介绍二、使用惰性队列1. 基于Bean2. 基于RabbitListener 一、介绍 当生产者发送消息的速度超过了消费者处理消息的速度,就会导致队列中的消息堆积,直到队列存储消息达到上限。最 早接收到的消息&#xff0c;可能就会成为死信&#xff0c;会被丢弃&#xff0c;这就…

Pod控制器:

Pod控制器&#xff1a; Pv pvc 动态PV Pod控制器&#xff1a;工作负载。WordLoad&#xff0c;用于管理pod的中间层 &#xff0c;确保pod资源符合预期的状态 预期状态&#xff1a; 副本数容器的重启策略镜像的拉取策略 Pod出现故障时的重启等等 Pod控制器的类型&#xff1a…