【计算机图形学】习题课: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.使用开源免费的社区版,企业版…

[Android] Android架构体系(1)

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

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

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

AI绘图制作红包封面教程

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

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

目录 一、设计模式概述 1.1、23种设计模式有哪些? 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设置 概述 本文介绍如何初始化传感器并配置其参数,以便在检测到自由落体事件时发送通知。 最近…

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

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

RabbitMQ常见问题之消息堆积

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

Pod控制器:

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

【大数据】Flink 详解(八):SQL 篇 Ⅰ

《Flink 详解》系列(已完结),共包含以下 10 10 10 篇文章: 【大数据】Flink 详解(一):基础篇【大数据】Flink 详解(二):核心篇 Ⅰ【大数据】Flink 详解&…

小程序系列--7.页面导航

一、页面导航 1、 什么是页面导航&#xff1f; 页面导航指的是页面之间的相互跳转。例如&#xff0c;浏览器中实现页面导航的方式有如下两种&#xff1a; <a> 链接 location.href 2. 小程序中实现页面导航的两种方式 二、声明式导航 1. 导航到 tabBar 页面 2. 导航…

Cellinx NVT 摄像机 UAC.cgi 任意用户创建漏洞复现

0x01 产品简介 Cellinx NVT IP PTZ是韩国Cellinx公司的一个摄像机设备。 0x02 漏洞概述 Cellinx NVT 摄像机 UAC.cgi接口处存在任意用户创建漏洞,未经身份认证的攻击者可利用此接口创建管理员账户,登录后台可查看敏感信息,使系统处于极不安全的状态。 0x03 复现环境 FO…

乐意购项目前端开发 #4

一、Home页面组件结构 结构拆分 创建组件 在 views/Home 目录下创建component 目录, 然后在该目录下创建5个组件: 左侧分类(HomeCategory.vue)、Banner(HomeBanner.vue)、精选商品(HomeHot.vue)、低价商品(Homecheap.vue)、最新上架(HomeNew.vue) 引用组件 修改 views/Home…

2. 示例:Spring Boot 入门

1.1 概述 Spring Boot是由Pivotal团队提供的全新框架&#xff0c;其设计目的是用来简化新Spring应用的初始搭建以及开发过程。习惯优于配置 1.2 为什么使用Spring Boot J2EE笨重的开发、繁多的配置、低下的开发效率、复杂的部署流程、第三方技术集成难度大。 1.3 Spring Bo…

设计模式——组合模式

生活中存在很多 “部分-整体” 的关系&#xff0c;例如&#xff1a;大学中的学校与学院、学院与专业的关系。高楼与楼层和房间之间的关系等等。在软件开发中也有类似的情况。这些简单对象与复合对象之间的关系&#xff0c;如果用组合模式&#xff08;把学校、院、系都看作是组织…

链表练习 Leetcode82.删除排序链表中的重复元素 II

题目传送门&#xff1a;Leetcode82 给定一个已排序的链表的头 head &#xff0c; 删除原始链表中所有重复数字的节点&#xff0c;只留下不同的数字 。返回 已排序的链表 。 示例 1&#xff1a; 输入&#xff1a;head [1,2,3,3,4,4,5] 输出&#xff1a;[1,2,5]示例 2&#xff1…

【Linux】Linux 系统编程——cd 命令

文章目录 1.命令概述2.命令格式3.常用选项4.相关描述5.参考示例 1.命令概述 “cd 命令&#xff0c;即 ‘change directory’ 的缩写&#xff0c;主要用于 Unix、Linux 和 macOS 等操作系统中&#xff0c;用于改变当前工作目录。该命令支持绝对路径和相对路径两种形式。若未指定…

SpringBoot多环境配置与添加logback日志

1、多环境配置 一个项目会有多个运行环境 所以SpringBoot提供了可以适应多个环境的配置文件 每个文件对应一个端口号 application-dev.yml 开发环境 端口8090 application-test.yml 测试环境 端口8091 application-prod.yml 生产环境 端口8092 在application中选择使用哪个…