计算机图形学(Lec5)

8.3 - Perspective Projections — LearnWebGL

Aspect ratio = width/height


由图易得 tan(fovY/2) = t/|n| aspect = n/t

What is MVP?

Model transformation

View transformation

Projection transformation

    -- Orthographic projection(cuboid to "canonial" cube[-1,1]3)

    -- Perspective projection(frustum to "canonial" cube)


Canonial cube to Screen

[-1,1]2  ---> [0, width] * [0, height]

M_{viewpoint} = \begin{Bmatrix} width/2 & 0 &0 & width/2\\ 0 & height/2 & 0 & height/2\\ 0 & 0 & 1 & 0\\ 0 & 0 & 0 & 1 \end{Bmatrix}

Rasterizing Triangles into pixels

Triangles-Fundamental Shape Primitives

Q : WHY TRIANGLES?

A : 

  • most basic polygon
    • break up other polygons
  • Unique properties
    • guranteed to be planar
    • Well-defined interior(存在明确的正反面)
    • Well-defined method for interpolating values for vertices over tirangle(barycentric interpolation 中心坐标插值)
for(int x = 0 ; x < xmax ; ++x)
    for(int y = 0 ; y < ymax ; ++y)
        image[x][y] = inside(tir,x+0.5,y+0.5);

Evaluating inside(tir,x,y)   How to realize?

Recall : Three cross products

Checking all pixels on the screen?

==> use a bounding box

for(int x = xmin ; x < xmax ; ++x)
    for(int y = min ; y < ymax ; ++y)
        image[x][y] = inside(tir,x+0.5,y+0.5);

==> Incremental Triangle Traversal(faster?)

         suitable for thin and rotated triangles(增量三角遍历,只寻找三角形的最左和最右)


Bayer Partern --> one method to represent pixels

What is wriong with pictures after being rasterizd?

    ==> Aliasing(jaggies) 锯齿 ->采样率

参考链接:bilibili.com/video/BV1X7411F744?p=5(GAMES101-现代计算机图形学入门-闫令琪)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值