GAMES101-05光栅化1(三角)

05Rasterization 1 (Triangles


)


一、Rasterization 1 (Triangles)


vertical field-of-view (fovY) andaspect ratio
长宽比和垂直的可视角度

How to convert from fovY and aspect to l,r, b, t?Trivial


What’s after MVP?
将物体锁定在(-1,1)^3的立方体内
Canonical Cube to Screen
What is a screen?

  • An array of pixels
  • Size of the array: resolution
  • A typical kind of raster display
    Raster == screen in German
  • Rasterize == drawing onto the screen
    Pixel (FYl, short for “picture element”)
  • For now: A pixel is a little square with uniform color
  • Color is a mixture of (red, green, blue)

    以屏幕的左下角为原点开始确定坐标。
    Pixels’ indices are in the form of (x, y)., where both x and y are integers
    Pixels" indices are from(0, 0) to (width - 1, height - 1)
    Pixel (x, y) is centered at(+0.5,y+0.5)

将宽高由(-1,1)拉长w,h

Drawing Machines
Laser Cutters
Different Raster Displays
Oscilloscope 示波器
Cathode Ray Tube 阴极射线管

隔行扫描,短暂的视觉暂留。高速运动时会产生严重的画面撕裂。
Frame Buffer: Memory for a Raster Display
内存的区域映射到屏幕上
Flat Panel Displays
LCD(iiquid Crystal Display)Pixel 液晶

光经过光栅只会留下在这个方向震动的波
通过光栅液晶的扭曲得到目标角度的光线。
LED Array Display 发光二极管
electropnoretic (Electronic lnk) Display 电子墨 kindle

  • Drawing to Raster Displays*
    Triangle Meshes表示二位空间
    Triangles - Fundamental Shape Primitives:
  • Most basic polygon
  • Break up other polygons
    Unique properties
  • Guaranteed to be planar
  • Well-defined interior
  • Well-defined method for interpolating values atvertices over triangle (barycentric interpolation)

A Simple Approach: Sampling采样
Samping a Function
Evaluating a function at a point is sampling.we can discretize a function by sampling.将函数离散化
以中心点采样

for (int x = 0; x < xmax; ++x)
for (int y=0; y <ymax; ++y)
image [x][y] = inside (tri,
+0. 5,y + 0.5) ;


p1p2*p1q朝外,在p1p2左侧
经过三次判断确定在以上那个区域内
若点在三角形边界上如何判定由自己觉定。

轴向包围盒
各种神奇的加速方法

Rasterization on Real Displays

bayer parten 绿色的点更多,因为人眼对绿色更为舒服

在这里插入图片描述
==Jaggies!==Aliasing
抗锯齿,防走样

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值