Презентация Drawing triangles онлайн
На нашем сайте вы можете скачать и просмотреть онлайн доклад-презентацию на тему Drawing triangles абсолютно бесплатно. Урок-презентация на эту тему содержит всего 32 слайда. Все материалы созданы в программе PowerPoint и имеют формат ppt или же pptx. Материалы и темы для презентаций взяты из открытых источников и загружены их авторами, за качество и достоверность информации в них администрация сайта не отвечает, все права принадлежат их создателям. Если вы нашли то, что искали, отблагодарите авторов - поделитесь ссылкой в социальных сетях, а наш сайт добавьте в закладки.
Презентации » Математика » Drawing triangles
Оцените!
Оцените презентацию от 1 до 5 баллов!
- Тип файла:ppt / pptx (powerpoint)
- Всего слайдов:32 слайда
- Для класса:1,2,3,4,5,6,7,8,9,10,11
- Размер файла:463.50 kB
- Просмотров:81
- Скачиваний:0
- Автор:неизвестен
Слайды и текст к этой презентации:
№3 слайд
Содержание слайда: Rasterizing Polygons
In interactive graphics, polygons rule the world
Two main reasons:
Lowest common denominator for surfaces
Can represent any surface with arbitrary accuracy
Splines, mathematical functions, volumetric isosurfaces…
Mathematical simplicity lends itself to simple, regular rendering algorithms
Like those we’re about to discuss…
Such algorithms embed well in hardware
№6 слайд
Содержание слайда: Convex Shapes
Why do we want convex shapes for rasterization?
One good answer: because any scan line is guaranteed to contain at most one segment or span of a triangle
Another answer coming up later
Note: Can also use an algorithm which handles concave polygons. It is more complex than what we’ll present here!
№8 слайд
Содержание слайда: Rasterizing Triangles
Interactive graphics hardware commonly uses edge walking or edge equation techniques for rasterizing triangles
Two techniques we won’t talk about much:
Recursive subdivision of primitive into micropolygons (REYES, Renderman)
Recursive subdivision of screen (Warnock)
№12 слайд
Содержание слайда: Edge Walking: Notes
Order vertices in x and y
3 cases: break left, break right, no break
Walk down left and right edges
Fill each span
Until breakpoint or bottom vertex is reached
Advantage: can be made very fast
Disadvantages:
Lots of finicky special cases
Tough to get right
Need to pay attention to fractional offsets
№14 слайд
Содержание слайда: Edge Equations
An edge equation is simply the equation of the line containing that edge
Q: What is the equation of a 2D line?
A: Ax + By + C = 0
Q: Given a point (x,y), what does plugging x & y into this equation tell us?
A: Whether the point is:
On the line: Ax + By + C = 0
“Above” the line: Ax + By + C > 0
“Below” the line: Ax + By + C < 0
№21 слайд
Содержание слайда: Computing Edge Equations
Want to calculate A, B, C for each edge from (xi, yi) and (xj, yj)
Treat it as a linear system:
Ax1 + By1 + C = 0
Ax2 + By2 + C = 0
Notice: two equations, three unknowns
Does this make sense? What can we solve?
Goal: solve for A & B in terms of C
№23 слайд
Содержание слайда: Computing Edge Equations:
Numerical Issues
Calculating C = x0 y1 - x1 y0 involves some numerical precision issues
When is it bad to subtract two floating-point numbers?
A: When they are of similar magnitude
Example: 1.234x104 - 1.233x104 = 1.000x101
We lose most of the significant digits in result
In general, (x0,y0) and (x1,y1) (corner vertices of a triangle) are fairly close, so we have a problem
№24 слайд
Содержание слайда: Computing Edge Equations:
Numerical Issues
We can avoid the problem in this case by using our definitions of A and B:
A = y0 - y1 B = x1 - x0 C = x0 y1 - x1 y0
Thus:
C = -Ax0 - By0 or C = -Ax1 - By1
Why is this better?
Which should we choose?
Trick question! Average the two to avoid bias:
C = -[A(x0+x1) + B(y0+y1)] / 2
№25 слайд
Содержание слайда: Edge Equations
So…we can find edge equation from two verts.
Given three corners C0, C1, C0 of a triangle, what are our three edges?
How do we make sure the half-spaces defined by the edge equations all share the same sign on the interior of the triangle?
A: Be consistent (Ex: [C0 C1], [C1 C2], [C2 C0])
How do we make sure that sign is positive?
A: Test, and flip if needed (A= -A, B= -B, C= -C)
№27 слайд
Содержание слайда: Optimize This!
findBoundingBox(&xmin, &xmax, &ymin, &ymax);
setupEdges (&a0,&b0,&c0,&a1,&b1,&c1,&a2,&b2,&c2);
/* Optimize this: */
for (int y = yMin; y <= yMax; y++) {
for (int x = xMin; x <= xMax; x++) {
float e0 = a0*x + b0*y + c0;
float e1 = a1*x + b1*y + c1;
float e2 = a2*x + b2*y + c2;
if (e0 > 0 && e1 > 0 && e2 > 0) setPixel(x,y);
}
}
№28 слайд
Содержание слайда: Edge Equations: Speed Hacks
Some speed hacks for the inner loop:
int xflag = 0;
for (int x = xMin; x <= xMax; x++) {
if (e0|e1|e2 > 0) {
setPixel(x,y);
xflag++;
} else if (xflag != 0) break;
e0 += a0; e1 += a1; e2 += a2;
}
Incremental update of edge equation values
(think DDA)
Early termination (why does this work?)
Faster test of equation values
№31 слайд
Содержание слайда: Edge Equations:
Interpolating Color
Notice that the columns in the matrix are exactly the coefficients of the edge equations!
So the setup cost per parameter is basically a matrix multiply
Per-pixel cost (the inner loop) cost equates to tracking another edge equation value
№32 слайд
Содержание слайда: Triangle Rasterization Issues
Exactly which pixels should be lit?
A: Those pixels inside the triangle edges
What about pixels exactly on the edge? (Ex.)
Draw them: order of triangles matters (it shouldn’t)
Don’t draw them: gaps possible between triangles
We need a consistent (if arbitrary) rule
Example: draw pixels on left or top edge, but not on right or bottom edge
Скачать все slide презентации Drawing triangles одним архивом:
-
Median, bisector and the height of the triangle
-
Bisector, median, height of the triangle
-
Triangle. Inequalities
-
Функції та їх графіки
-
Числовые последовательности. Занимательная математика
-
Арифметическая прогрессия. Занимательная математика
-
Переход от передаточных функций к дифференциальным уравнениям и структурным схемам
-
Построение желаемой ЛАЧХ разомкнутой системы в частотном методе синтеза корректирующего звена
-
Построение асимптотических ЛАЧХ и ЛФЧХ для передаточных функций общего вида
-
Графический метод решения уравнений и неравенств
-
Бөлшектік еселікпен резервтеу. Көпшілік дауыс беру бойынша резервтеу. Лекция 5