全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 Rasterisation, edge function, top-left rule?

又称: rasterisation · edge function · top-left rule

Definition 31.4 University Computer Science — Year 3 · 第 31 章 — Computer Graphics: From Triangles to Pixels

Rasterisation is the computation of the set of pixels that a shape covers; a pixel is covered by a triangle when its centre is inside the triangle. The edge function of the directed edge from aa to bb is

Eab(p)=(bx−ax)(py−ay)−(by−ay)(px−ax),E_{ab}(p) = (b_x - a_x)(p_y - a_y) - (b_y - a_y)(p_x - a_x),

twice the signed area of the triangle (a,b,p)(a, b, p); it is zero on the line abab and has opposite signs on its two sides. The top-left rule decides the centres that lie exactly on an edge: such a centre is drawn only if the edge is a top edge, horizontal with the triangle below it, or a left edge, with the triangle to its right.

The top-left rule on a triangle drawn with y up for reading. Dots are pixel centres. Of the centres on the triangle’s edges, those on the top and left edges are drawn, filled, and those on the right edge are not, hollow: the neighbour across that edge draws them. A corner is drawn only if both its edges are top or left: a is, b and c are not.
The top-left rule on a triangle drawn with yy up for reading. Dots are pixel centres. Of the centres on the triangle’s edges, those on the top and left edges are drawn, filled, and those on the right edge are not, hollow: the neighbour across that edge draws them. A corner is drawn only if both its edges are top or left: aa is, bb and cc are not.
在原文中阅读 →