cpt205计算机图形学自用记录

把这些问题都搞懂了也许就能考好

Computer graphics是什么:

all aspects of producing pictures or images using a computer.包含image,code和mathematical model

有哪三种device:

• Input Devices • Processing Devices • Output Devices

Framebuffer是什么:

A block of memory, dedicated to graphics output, that holds the contents of what will be displayed.专用于图形输出的内存块,保存将要显示的内容。

RGBA使用多少bit一个pixel?

32bits

RGBA的a是什么?

Opacity不透明度

Screen Resolution屏幕分辨率是什么?

number of pixels on a screen

Interlaced隔行扫描是什么?

scan every other line at a time, or scan odd and even lines alternatively; the even scan lines are drawn and then the odd scan lines are drawn on the screen to make up one video frame.

Cartesian co-ordinates和computer screen的区别:

cartesian是从下向上y加,computer是从上向下y加

Gradient/slope of a line?

AB = ∆y/∆x

How to prove two lines are perpendicular?

The product of the two gradient is -1

四象限quadrant是怎么定义的?

额外知识:2象限sin正,3象限tan正,4象限cos正

向量点乘和叉乘:

V1•V2 = |V1||V2|cos(α) = x1x2 + y1y2

V1 x V2 = |V1||V2|sin(α)n,n是两向量平面右手定理的unit vector

Transpose matrix是什么?

row和column interchange了

Identity matrices是什么?

diagonal elements是1其他都是0

Inverse matrices是什么?

两个matrices相乘为Identity matrix

DDA – Digital Differential Algorithm是什么?

一个algorithm用于画线,

The Bresenham line algorithm的优点:

accurate and efficient. uses only integer calculations

简要描述Use of symmetry to reduce computation for circle generation:

只用画一个octant(八分之一圆)

polygons定义:

an ordered set of vertices

复杂图形为什么是由多个三角形组成的?

Because triangular polygons are always flat

Polygon fill的流程

1.Rasterize edges into framebuffer. 2.Find a seed pixel inside the polygon 3.Visit neighbours recursively and colour if they are not edge pixels.

OpenGL怎么画三角形?

考试逆天题目:简要描述gl,glu和glut function

ChatGPT答案非正式答案

In OpenGL, gl is the core library that provides basic drawing functions like shape rendering and color setting. glu is a utility library offering higher-level features such as camera views and matrix transformations. glut is a cross-platform toolkit simplifying window and user input management, making it easier to create basic graphical user interfaces. Together, these three libraries provide developers with powerful tools for building graphic applications.

在OpenGL中,gl是核心库,提供基本的绘图功能,如绘制形状和设置颜色。glu是一个实用库,提供了一些高级的辅助功能,如相机视图和矩阵变换。glut是一个跨平台工具包,用于简化窗口和用户输入的管理,使得创建基本图形用户界面更加容易。这三个库一起为开发者提供了强大的工具,用于创建图形应用程序

什么是Transformation pipeline

The Transformation Pipeline is the series of transformations (alterations) that must be applied to an object before it can be properly displayed on the screen.

分为Modelling-Viewing-Projection-Normalisation-Device五个转换

Modelling Transformation - to place an object into the Virtual World.

Viewing Transformation - to view the object from a different vantage point in the virtual world.

Projection Transformation - to see depth in the object.

Viewport Transformation - to temporarily map the volume defined by the "window of interest" plus the front and rear clipping planes into a unit cube. When this is the case, certain other operations are easier to perform.

Device Transformation - to map the user defined "window of interest" (in the virtual world) to the dimensions of the display area.

Transformation pipeline的开始和结束

We start when the object is loaded from a file and is ready to be processed.

We finish when the object is ready to be displayed on the computer screen.

Rotation about a fixed point rather than the origin怎么操作

1.Move the fixed point to the origin 2.Rotate the object 3.Move the fixed point back to its initial position

3Drotation和2Drotation的不同

2D根据坐标原点旋转,3D根据坐标轴多次旋转。

z轴转x'是cos-sin,y轴转z'是cos-sin,x轴转y'是cos-sin

OpenGL中怎么旋转?

最后的矩阵最先执行。

Viewing requires three basic elements

One or more objects

A viewer with a projection surface

Projectors that go from the object(s) to the projection surface

Planar geometric projection的特点

Projectors are lines that either converge at a centre of projection or are parallel.

preserve lines but not necessarily angles.

Perspective projection透视投影和Parallel projection平行投影

透视有Centre Of Projection平行有Direction Of Projection

Axonometric projections轴测投影

按投射的正方形三角度数相等数分为3:isometric 2:dimetric 1:trimetric

Vanishing point是什么

Parallel lines on the object converge at a single point in the projection

3D viewing co-ordinate parameters怎么设立

一般以-Zview 作为viewing plane的normal vector,camera point作为原点

frustum perspective projection特点

If the viewing plane is behind the projection reference point, objects are inverted on the view plane.

观察点垂直观察观察面,在观察方向后的观察面会反向

Parametric curves的Implicit和Parametric (explicit) representation

Implicit:例如y = a0 + a1x

explicit:例如x = x1 + t(x2 – x1) (0 ≤ t ≤ 1) y = y1 + t(y2 – y1)

Interpolation through k points(多项式与点的关系)

点越多就需要越多次方的x,例如k=3就需要x^2的多项式polynomials拟合

Splines的三种连续性

- continuity of the curve (no breaks)

- continuity of tangent切线 (no sharp corners)

- continuity of curvature曲率 (not essential but avoids some artefact from lighting)

An interpolation curve定义

定义了必须经过的点的曲线

design curve定义

定义了曲线的general behavior

这些曲线的local control

Tension pull curve tight between points if increase

bias decide where to pull the curve

Extruded surface是什么

一条曲线moved perpendicular to its own plane垂直于其自身平面移动

Revolved surface是什么

a 2D curve is revolved around an axis

Swept surface是什么

2d curve 延一条3d线运动

Wireframe modelling的优缺点和应用

优点是最简单

缺点是the ambiguity of the model and the severe difficulty in validating the model.模型的模糊性和模型验证的严重困难

it does not provide surface and volume related information. 不提供表面和体积相关信息。

Surface modelling的优缺点和应用

优点more complete and less ambiguous representation,提供表面信息

缺点不提供体积信息

应用design and representation of car bodies.

Solid modelling的优缺点和应用

优点是包含所有有用信息

缺点复杂

Constructive solid geometry是什么

简化版:一个CSG tree 包含primitive solid和operations

特性是Nonuniqueness

boundary representation

represents a solid by segmenting its boundary into a finite number of bounded subsets.

通过将实体的边界分割成有限数量的有界子集来表示实体。

可以分为manifold and nonmanifold.

In a manifold model, an edge is connected exactly by two faces and at least three edges meet at a vertex.一条边由两个面精确连接,并且至少三个边在一个顶点相交。

A nonmanifold model may have dangling faces, edges and vertices, and therefore represent a non-realistc object.表示非现实对象。

manifold的验证(ruler' law)

Euler’s law

V - E + F - R + 2H - 2S = 0

vertices, edges, faces, rings (inner loops on faces), passages/holes (genus) and shells (disjoint bodies)

简化是V - E + F – 2 = 0

Primitives都有哪些

Cone, Sphere, GeoSphere, Teapot, Box, Tube, Cylinder, Torus

圆锥体、球体、地球球体、茶壶、盒子、管、圆柱体、环面

Hierarchical Modelling分层建模

利用原型进行scale,translate,rotate进行建模

放弃了考到自由发挥

point light

The light rays are generated along radially diverging paths from the light source position.

光线从光源位置沿着径向发散的路径产生。

Directional light

无限远处来的光,可以认为是平行光

Spot lights

存在directional limits,在限制外的物体不受光照

影响光照的三个因素

Ambient light环境光,The effect is a general background non-directed illumination.效果是一般的背景非定向照明。

Diffuse reflectance漫反射,漫反射指粗糙的物体表面将反射光线向各个方向均匀地散射出去,人眼所接收到的光亮度与观察者的位置无关。

Specular reflectance镜面反射,镜面反射遵循光的反射定律。

光的结合

两个光结合是加法,例如(0.2,0.3,0.4)和(0.3,0.4,0.5)相加为(0.5,0.7,1.0)超过1.0的为1.0

光和材质结合是把两者相乘,如(0.8, 0.6, 0.2) and a material (0.0, 1.0, 0.5),就是(0,0.6,0.1)

Attenuation光的衰减

Lighting model and shading用什么

Phong model太复杂了看不懂

Polygonal Shading多面体着色

分为三种1.Flat (constant) shading,同一多面体缺点在于can see even small differences in shading between adjacent polygons.

2.Smooth (interpolative) shading,The rasteriser interpolates colours assigned to vertices across a polygon.光栅化器插入分配给多边形顶点的颜色。每个顶点都有自己颜色

3.Gouraud shading高氏着色,顶点法线由周围的多面体决定(向量都加在一起然后除以长度和)

texture mapping是什么

map patterns onto the geometric description of the object

将图案映射到对象的几何描述上

Magnification and minification是什么

texel比pixel少就magnification,把一个texel对应多个pixel,a texel may be mapped to more than one pixel

texel比pixel多就minification,把一个pixel对应多个texel,a pixel may be covered by multiple texels

Briefly describe the co-ordinate systems used for texture mapping.描述四个坐标系系统

 Parametric co-ordinates may be used to model curves and surfaces

 Texture co-ordinates is used to identify points in the image to be mapped

 Object or world co-ordinates conceptually, where the mapping takes place

 Window co-ordinates where the final image is finally produced

Second mapping是什么

Mapping from an intermediate object to an actual object从中间物体map到实际物体。

Texture wrapping有哪两种

Repeat重复

CLAMP截断

Mipmapping是什么?

是一种用于优化3D图形渲染性能和视觉效果的技术。它通过在生成纹理时创建一系列缩小版本的图像(称为Mipmap层级),根据相机距离选择合适的层级,以减少远处细节和抗锯齿时的计算负担,提高渲染性能并改善图像质量。

Clipping window vs viewport

The clipping window selects what we want to see in our virtual 2D world.

The viewport indicates where it is to be viewed on the output device

clipping原因

Rasterization is very expensive,– Remove objects or parts of objects that are outside the clipping window to reduce computation。

Cohen-Sutherland 2D line clipping

Creates an outcode for each end point that contains location information of the point with respect to the clipping window

  • 如果该区域在屏幕的上方,第一个字节位是1
  • 如果该区域在屏幕的下方,第二个字节位是1
  • 如果该区域在屏幕的右边,第三个字节位是1
  • 如果该区域在屏幕的左侧,第四个字节位为1

如果有可能有交集就做intersecting with one of window edges

3D line clipping

Liang-Barsky

计算简单

Painter’s algorithm

Render polygons in the back to front order so that polygons behind others are simply painted over.从后往前画

Back-face culling

v•n ≥ 0 view direction点乘normal vector 大于0就是可见

对non-polygon和non-closed无效

Image space approach and Z-buffer

知道pixel对应物体但是物体多,不确定哪一个在前面

Now for each polygon, we have a set of pixel values which the polygon covers.

For each of the pixels, we compare its depth (z-value) with the value of the corresponding element already stored in the Z-buffer:

现在对于每个多边形,我们都有一组多边形覆盖的像素值。

对于每个像素,我们将其深度(z 值)与已存储在 Z 缓冲区中的相应元素的值进行比较:

• 如果该值小于先前存储的值,则该像素比先前遇到的像素更靠近观察者;

• 将Z 缓冲区的值替换为当前像素的z 值,并将颜色缓冲区的值替换为当前像素的值。

Repeat for all polygons in the image.

Advantages

 The most widely used hidden-surface removal algorithm;

 An image-space algorithm which traverses scene and operates per polygon rather than per pixel;

 Relatively easy to implement in hardware or software;

 We rasterize polygon by polygon and determine which (part of) polygons get drawn on the screen.

Ø 应用最广泛的隐藏面去除算法;

Ø 一种图像空间算法,它遍历场景并按多边形而不是按像素进行操作;

Ø 硬件或软件都比较容易实现;

Ø 我们逐个多边形地光栅化并确定在屏幕上绘制哪些(部分)多边形。

scan-line algorithm

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值