Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Rawesak Tanawongsuwan
ccrtw@mahidol.ac.th
4 86
Vector Graphics
• Compact
• Scalable
•
http://www.prepressure.com/image/bitmapvector.htm
Resolution-independent
Coordinates
• Rectangular array of pixels, each pixel may be
identified by row and column numbers (r,c)
• P = (x, y) (3,4)
4 88
Vectors
• Specify a displacement by movements in x
and y directions
P1
x2 − x1
4 88–89
Rendering
• Represent lines, curves, shapes,... by parameters of their
defining equations
• e.g. line y = mx + c, store m and c (or endpoints)
• Compute pixels which must be set in order to draw the line etc
Aliasing
http://en.wikipedia.org/wiki/Aliasing
4 89–91
Anti-aliasing
• Rendering is sampling & reconstruction
http://www.richleader.com/images/Pulse/bargainbin/bargain_bin_review/anti-aliasing.png
4
Anti-aliasing
http://en.wikipedia.org/wiki/Anti-aliasing
4 91–92
Shapes
• Drawing programs and vector graphics
languages provide basic repertoire of shapes
that can easily be represented mathematically
Spline representations
Spline usage
• Design curve and surface shapes
• Digitize drawings
• CAD applications
4
• 3 points parabola
• 4 points cubic
4
Bézier Curves
• Smooth curves
completely specified
by four control points
• 2 endpoints (P1, P4)
• 2 direction points
(P2, P3)
Paths
• Bézier curves can be easily combined to make
elaborate smooth paths
• Closed path joins up on itself, open path
doesn't
4
Join paths
• If two curves join at a point in such a way that their
direction lines through that point form a single line
extending the same distance in both directions, the
join will be smooth
• Pen tool in drawing programs lets you build up
curves in this way by dragging at successive
anchor points
4 96–99
Pattern fills
• Allow a repeating pattern to fill in an area. Patterns are
built out of elements called tiles (small piece of image)
Inside or Outside
Transformations
• Manipulate vector objects in certain ways by
changing stored values that describe them
• Translation (linear movement)
• Scaling
• Reflection
• Rotation
• Shearing (skewing)
Transformations
4
Transformations
translate
rotate
shear
scale
reflect
4
Filtering
4
Sample images
(done by Illustrator)
http://northlite.50megs.com/illus/illusgallery/IllustratorGallery/
4
Larger version
4 103–104
Y
• Practically complicated and difficult
3-D Rendering
• Start with mathematical model of objects in 3-
D space, need a 2-D picture, usually in
perspective
Winner of
POVCOMP 2004
by Johnny Yip
http://www.povcomp.com/results.php
4
"The Kitchen"
by Jaime Vives Piqueres - ranked 2nd
http://www.povcomp.com/results.php
4
"Dissolution" by NEWT - ranked 3rd
http://www.povcomp.com/results.php
4 106
http://www.flashdevils.com/reviews.php?id=1345&Swift%203D%20v3.html
4 108–111
Procedural Modelling
• Define an object by giving algorithm for constructing it
• Fractals
• Exhibit same structure at all levels of detail
• Model landscape features, clouds etc
• Particle systems
http://astronomy.swin.edu.au/~pbourke/fractals/fracintro/
http://www.darwin3d.com/gamedev/gdm0798.jpg
https://www.internal.pandromeda.com/engineering/
musgrave/unsecure/S01_Course_Notes.html
4 111–112
3-D Rendering
• Wire frame
Shading Algorithms
• Interpolate colour across each polygon to disguise discontinuities
Shading Algorithms
• Take account of interaction between objects