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

news2024/11/26 18:54:13

【计算机图形学】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.coloradmin.cn/o/1393291.html

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

相关文章

2024年腾讯云轻量服务器和CVM云服务器性能如何?

腾讯云轻量服务器和云服务器有什么区别?为什么轻量应用服务器价格便宜?是因为轻量服务器CPU内存性能比云服务器CVM性能差吗?轻量应用服务器适合中小企业或个人开发者搭建企业官网、博客论坛、微信小程序或开发测试环境,云服务器CV…

进阶Docker4:网桥模式、主机模式与自定义网络

目录 网络相关 子网掩码 网关 规则 docke网络配置 bridge模式 host模式 创建自定义网络(自定义IP) 网络相关 IP 子网掩码 网关 DNS 端口号 子网掩码 互联网是由许多小型网络构成的,每个网络上都有许多主机,这样便构成了一个有层次的结构。 IP 地…

新品发布 | 思腾合力深思系列「IW4235-4GRc」4U机架式高性能服务器

新品发布 | 思腾合力深思系列「IW4235-4GRc」4U机架式高性能服务器 Sitonholy 思腾合力 2024-01-17 17:35 发表于北京 采用第4/5代Intel Xeon 可扩展处理器 4U标准的机架式高性能服务器 极致性能提升 支持第4/5代Intel Xeon 可扩展处理器,CPU 3 UPI性能高达16 GT/s…

重置aws上的ssh默认登录端口

aws上的ec2机器,默认ssh的登录都是22,为了防止被黑,记录下修改该默认端口的方法 修改/etc/ssh/sshd_config文件,将Port 22注释去掉在上面的文件中,加入一行,你想要增加的端口号,格式和22一致注意&#xff1…

云原生场景下,AIGC 模型服务的工程挑战和应对

作者:徐之浩、车漾 “成本”、“性能”和 “效率”正在成为影响大模型生产和应用的三个核心因素,也是企业基础设施在面临生产、使用大模型时的全新挑战。AI 领域的快速发展不仅需要算法的突破,也需要工程的创新。 大模型推理对基础设施带来…

2024.1.18每日一题

LeetCode 2171.拿出最少数目的魔法豆 2171. 拿出最少数目的魔法豆 - 力扣(LeetCode) 题目描述 给定一个 正整数 数组 beans ,其中每个整数表示一个袋子里装的魔法豆的数目。 请你从每个袋子中 拿出 一些豆子(也可以 不拿出&a…

机器视觉系统在汽车车轮毂检测上的应用

将机器视觉用于轮毂检测,可以利用图像分析的方法来测量轮毂特征尺寸、判断轮毂形状,并获取其位置坐标等信息,从而能够辨识流水生产线上的各种款式和型号的汽车轮毂。 市面上对汽车车轮毂具体检测要求如下 : 1.为了分辨流水线上…

Chrome 开发者工具

Chrome 开发者工具 介绍控制面板时间线下载信息概要请求列表单个请求时间线优化时间线上耗时项 lighthouse 插件Performance(性能指标)Accessibility(可访问性)Best Practices(最佳实践)SEO(搜索…

在 Jenkins 中使用 SSH Servers 配置文件上传路径

引言 在使用 Jenkins 进行持续集成和持续部署(CI/CD)的过程中,有时我们需要将构建好的文件上传到远程服务器。本文将介绍如何在 Jenkins 的 SSH Servers 配置中设置文件的上传目录,以及这些设置是如何组合以形成最终的上传路径。…

AJAX和Axios异步框架

AJAX:Asynchronous JavaScript And XML 异步的JavaScript和XML 作用:1、与服务器进行数据交换,通过AJAX可以给服务器发送请求,并获取服务器响应数据。使用了AJAX和服务器进行通信,就可以使用ajax和html来代替jsp页面了…

Python4Delphi安装及编译

1.下载或直接克隆python4delphi组件资源到指定目录,我这里下载到Components文件夹下,并对下载的文件夹进行了重命名为(P4D),重命名不是必须的 下载地址:https://github.com/pyscripter/python4delphi 2.安装 2.1在已下载的目录下进入Install文件夹,双击MultiInstaller.exe…

基于python+uniapp的网上订餐系统的设计与实现 微信小程序

考虑到实际生活中在晓海网上订餐方面的需要以及对该系统认真的分析,将系统权限按管理员和用户这两类涉及用户划分。 (1)用户功能需求 用户进入APP可以进行首页、系统公告、在线投诉、我的等操作,在我的页面可以对菜品评价、订单信…

医院网络安全建设:三网整体设计和云数据中心架构设计

医院网络安全问题涉及到医院日常管理多个方面,一旦医院信息管理系统在正常运行过程中受到外部恶意攻击,或者出现意外中断等情况,都会造成海量医疗数据信息的丢失。由于医院信息管理系统中存储了大量患者个人信息和治疗方案信息等,…

Servlet 预览pdf

一、背景 上篇文章介绍了图片的预览,这篇我们介绍下 pdf 文件的预览,pdf 预览在实际开发中用的还是比较多的,比如很多文件协议、合同都是用pdf 格式,协议预览就需要我们做 pdf 预览了。 二、实操 其实在上篇文章最后已经说了常用…

七陌API对接实战:外呼接口及通话记录推送

通过白码低代码开发平台对接七陌外呼接口,实现选择客户进行外呼,并保存通话记录的功能。 外呼接口实现: 官方接口文档:http://developer.7moor.com/v2docs/dialout/ 1、对接数据查询 向七陌商务索取到七陌用户中心账号密码&a…

C++ //练习 1.1 查阅你使用的编译器的文档,确定它所使用的文件命名约定。编译并运行第2页的main程序。

C Primer(第5版) 练习 1.1 练习 1.1 查阅你使用的编译器的文档,确定它所使用的文件命名约定。编译并运行第2页的main程序。 环境:Linux Ubuntu(云服务器) 工具:vim 代码块 /***************…

L3上云01 | 分布式、微服务概念

文章目录 什么是分布式,分布式和集群的区别又是什么?1. 什么是分布式 ?2. 分布式与集群的区别 ?分布式集群 3. 分布式环境下面临的问题4. 常见的分布式系统5. 什么是微服务架构?S0A 架构微服务 什么是分布式,分布式和集群的区别…

响应式Web开发项目教程(HTML5+CSS3+Bootstrap)第2版 例4-3 textarea

代码 <!doctype html> <html> <head> <meta charset"utf-8"> <title>textarea</title> </head><body> <h2>多行文本框:</h2> <!--textarea&#xff08;文本域&#xff09;cols(列) rows(行)--> …

鸿蒙Harmony-页面路由(router)详解

慢慢理解世界&#xff0c;慢慢更新自己&#xff0c;希望你的每一个昨天&#xff0c;今天&#xff0c;和明天都会很快乐&#xff0c;你知道的&#xff0c;先好起来的从来都不是生活&#xff0c;而是你自己 目录 一&#xff0c;定义 二&#xff0c;页面跳转 2.1使用router.pushU…

您没有专业应用组许可,请联系系统管理员分配许可!

项目场景&#xff1a; 金蝶云星空客户端 问题描述 您没有专业应用组许可&#xff0c;请联系系统管理员分配许可! 解决方案&#xff1a; 第一步&#xff1a;使用管理员账号登录&#xff0c; 第二步&#xff1a;查询用户》勾选指定用户》注册用户同步