Todos los libros

Profesional

Apps Acerca de Coach Iniciar sesión Empezar a leer

Computer Science · Glosario

¿Qué es Rasterisation, edge function, top-left rule?

También llamado: rasterisation · edge function · top-left rule

Definition 31.4 University Computer Science — Year 3 · Capítulo 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.
Leer en el capítulo →