11 views

Uploaded by John Brian Ignacio

- Inkscape Guide to a Vector Drawing Program Preview- By Tavmjong Bah
- KilimanjaroTutorial
- Computer Graphics Unit1
- ware county district tech fair registration form
- fast town tutorial
- LECTURE 1.pptx
- PS Text Effects
- TIB Sfire Autsvcs 7.6.0 User Manual
- Artificial Intelligence, Simulation and Modelling
- Adobe Animate Training Class Introduction
- CG
- GRASS 6.4.0 Command list.pdf
- lesson plan graphing shapes wb
- OpenOffice-DrawGuide
- Terzidis Expr Form
- An Online Geomechanics Course With a Virtual Rock Lab Based on Streaming Audio and Vector Graphics (1)
- Course 5 - Curves
- 4_vasky
- p2
- Report Rain

You are on page 1of 20

Vector graphics refers to representing images by mathematical descriptions of geometric objects, rather than by a collection of pixels on the screen (raster graphics). Punchline: If we represent points of space in the right way, we can represent all sorts of motions and deformations of shapes by matrix multiplication.

Geometrically, we can represent a polygon by a collection of vertices and the order in which to connect them. This is a lot less data to store in memory than the collection of all the pixels that are to be colored, especially as the polygon gets larger. If we want to represent other shapes, we need to store: What kind of shape it is Enough points and distances to fully describe the shape (if we have this option) The style and color of the outline (if we have this option) The style and color of the inside For example, for a circle we would need to know it was a circle, then have the center and radius.

Asteroids

Manipulating a Ship

Lets represent the ship by a triangle, starting with its vertices at (0, 0), (2, 0), (1, 3).

f f

We could represent this as a matrix of vertices, with the understanding (stored as an additional piece of data) that they are connected in order and the last connects to the rst. 0 2 1 0 0 3

A matrix of vertices allows us to represent rotation by matrix multiplication, but what about translation? If we wanted to move r units to the right and s units up, wed have to add: 0 2 1 0 0 3 + r r r s s s

With a simple modication of the vertex matrix, though, we can represent translation by matrix multiplication using shear transformations (adds a multiple of one coordinate to each of the other coordinates). We just add a dummy coordinate that always holds value 1, and add multiples of that to the x and y coordinates.

Homogeneous Coordinates

In the new scheme, our triangle 0 0 1 ship is represented by the matrix 2 1 0 3 1 1

1+r 3+s 1

Flying Forward

Suppose we want to y our ship two units in the direction it is currently facing (up). We need to translate by (0, 2): 1 0 0 0 2 1 0 2 1 0 1 2 0 0 3 = 2 2 5 0 0 1 1 1 1 1 1 1 The new vertices, (0, 2), (2, 2), (1, 5), give us the new ship image:

f ff f

Turning in Place

Well crash into an asteroid if we cant change direction. Lets nd the images of the columns of I2 under counterclockwise rotation at an angle of . x2

y2 44 y1 44 4

x1

1 0 0 1

x1 y1 x2 y2

= =

The rst two columns of I3 will do just the same thing, with a zero in the last place. Our extra coordinate will stay the same. Hence to obtain counterclockwise rotation by degrees, we multiply by the matrix cos sin 0 sin cos 0 0 0 1 For example, for a 90 turn to the left, we would compute: 0 1 0 0 2 1 0 0 3 1 0 0 0 0 3 = 0 2 1 0 0 1 1 1 1 1 1 1

f f

Thats not the way ships turn, though! And if we rotate our ship after it drives up 2 units, its even worse:

f f

We want our rotation to be about the center of the ship, say, the point halfway between the front and back ends on the line straight back from the tip. In our beginning position that is (1, 1.5).

p f f

One solution is to translate, rotate, and translate back: make the center of the triangle the origin, do the rotation as previously, and then move the center back where it belongs. If we move everything by the amount the center requires, everything will stay in its proper positions.

We multiply on the left by each operations matrix in order. Hence the new vertices are given by A1 BAM where M is the matrix of homogeneous coordinates, A gives translation by (1, 1.5), B rotation by 90 , and A1 translation by (1, 1.5). 1 0 1 0 1 0 1 0 1 A1 BA = 0 1 1.5 1 0 0 0 1 1.5 0 0 1 0 0 1 0 0 1 0 1 2.5 = 1 0 0.5 0 0 1 0 1 2.5 0 2 1 2.5 2.5 0.5 (A1 BA)M = 1 0 0.5 0 0 3 = 0.5 2.5 1.5 0 0 1 1 1 1 1 1 1

The multiplication claims our vertices after rotation should be at (2.5, 0.5), (2.5, 2.5), and (0.5, 1.5). Lets graph it.

f p f

Much better! The corresponding action for our ship after moving forward two units involves translating by (1, 3.5) and back with the rotation in between. The vertices obtained are (2.5, 2.5), (2.5, 4.5), and (0.5, 3.5) (the previous vertices with y + 2).

f p f

Weve mentioned that the same amount of data is required to represent an object of a given shape no matter what its size. Along those lines, resizing vector objects can be done with perfect quality maintenance. To go from 4 6 to 400 600, you simply multiply by a dilation matrix and then make the connections as usual. A raster image must be sharpened if it is blown up too much. Another advantage is that these are device-independent descriptions. No matter what kind of screen is going to display the picture, if you give the vector description to the machine it can (with proper software, of course) convert that description into an image that will display properly on its hardware.

So Why Raster?

A little bit of history: For a brief time, displays were actually vector displays (calligraphic or X-Y). A beam would trace out the desired image on an otherwise black screen, many times per second. Modern displays, though, are raster (back to the early 1980s or even before), so a vector graphic must be converted to raster (a bitmap) in order to display. This meant that for two-dimensional games it was often easier to deal with raster graphics from the start. Additionally, a low-resolution display gives a lot more importance to each individual pixel, and it is not ecient to tweak individual pixels with vector representation.

High-resolution displays decrease the need to tweak images at the pixel level, so vector representations can give quality images while maintaining eciency. Perhaps more importantly, many games are now 3D. Raster graphics would require representing the entire solid object, despite the fact that we only need to see the surface. With 3D games there is also a lot more manipulation of the objects, as the player moves around and looks from dierent angles. These combine to make a vector representation again the better choice. However, raster representation is still more ecient for textures and patterns, so modern games use a combination of vector graphics for objects and raster graphics for surface detail. A couple more examples of vector graphics follow.

Battlezone

(Atari, 1980)

Star Wars

(Atari, 1983)

Title slide graphic is of Armor Attack (Cinematronics, 1980) All images are from Wikipedia, en.wikipedia.org

- Inkscape Guide to a Vector Drawing Program Preview- By Tavmjong BahUploaded byNitir Aseem
- KilimanjaroTutorialUploaded byetsimo
- Computer Graphics Unit1Uploaded byanitadas197861
- ware county district tech fair registration formUploaded byapi-256455930
- fast town tutorialUploaded byStefan Schloesser
- PS Text EffectsUploaded byapi-26658163
- TIB Sfire Autsvcs 7.6.0 User ManualUploaded byChryss26
- LECTURE 1.pptxUploaded byChristina Hayek
- Artificial Intelligence, Simulation and ModellingUploaded byFiras Alameddine
- Adobe Animate Training Class IntroductionUploaded byShah Affendi
- CGUploaded byMohit Saini
- GRASS 6.4.0 Command list.pdfUploaded byJose Murillo
- lesson plan graphing shapes wbUploaded byapi-357136333
- OpenOffice-DrawGuideUploaded byMikeVV
- Terzidis Expr FormUploaded byΜαρία Στούαρτ
- An Online Geomechanics Course With a Virtual Rock Lab Based on Streaming Audio and Vector Graphics (1)Uploaded byjuan Perez
- Course 5 - CurvesUploaded bylavao
- 4_vaskyUploaded bycooljoy4me
- p2Uploaded byapi-300831642
- Report RainUploaded bypavithra pavi
- AngelCG01.pptUploaded byFaizabadi Ahmed Rimaz
- Computer Graphics AnimationUploaded byRajesh Maa Tam
- sciencelessonplanUploaded byapi-334954783
- Android Phone DevelopmentUploaded byRanierLizada
- lesson plan k sped -shape housesUploaded byapi-301517206
- lesson plan of shapesof pre k 2Uploaded byapi-356168228
- alexa nichilo lessonplangrade1math reviewedUploaded byapi-311871134
- Computer Graphics Lab 3 2k10 CP.pdfUploaded byrenju
- lineUploaded byapi-266439580

- the migration history of the nazca ridge along the peruvian active margin.pdfUploaded bySmith Michael Parillo
- Physics Lab ReportUploaded bytanveer111222333
- QT9_1SDC007108G0202Uploaded byJeyakumar
- civ200__Uploaded byjohney2
- tugas praktikum metstatUploaded byAnggraini Fabrila
- Extractive Metallurgy of IronUploaded byBharichalo007
- elec2796_5Uploaded byvijay_786
- Blackbody RadiationdUploaded byCheong Kang Jin
- Dld ManualUploaded byDani Chaudhry
- ONGC - Drilling Operation Practices Manual.-2007Uploaded bytarang_tushar
- HPKM Column Shoes PeikkoGroup-8-2012Uploaded byGustavo Emilio Pàez Rosales
- What is a Critical Review of a Journal ArticleUploaded bybranch2012
- Interview TCEUploaded bygeinji_gow
- Metal_Finishing_-_May_2009Uploaded byqyly78
- IntroUploaded byJoshua Emmanuel Pagulong
- Thermometer AssignmentUploaded byJay Kim
- 6th sem syllabus ip university btech maeUploaded byAshish
- Cont Beam MdUploaded byAlexander Narváez
- Oracle Solaris Cluster 4.x Administration NEWUploaded bydavsjams
- Balanced Cantilever Bridge Analysis Day 3Uploaded byIsidro Buquiron
- En-IsO-14683 Transfer Termic Punte TermicaUploaded byAndrei David
- Computer Machinery and Intelligence SummaryUploaded byAdrian Parnacio
- ILLUSTRATED GLOSSARY OF SHIP AND BOAT TERMS.pdfUploaded bywoodalcm
- humping.pdfUploaded bylustronegro
- Apele Minerale in Carpatii de EstUploaded byMirunaVasile
- Tablet Hardness TesterUploaded bymandala561
- Transformer Engineering_ Design and PracticeUploaded byarpit0042
- Biomass - Detection Production and UsageUploaded byRahul Chauhan
- Microwave Grid Antennas 323-333Uploaded byFabio Costa
- ExtensionsUploaded bysara sarad