1 / 66

2IV10 Computergrafiek set 1-inleiding

2IV10 Computergrafiek set 1-inleiding. Jack van Wijk TU/e. Computergrafiek. Doel: Kennis over en ervaring met basisconcepten 2D en 3D computergrafiek Vorm: colleges, instructies Beoordeling: tentamen, opdracht. Colleges. 15 stuks (max.) Overzicht van stof

zofia
Télécharger la présentation

2IV10 Computergrafiek set 1-inleiding

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 2IV10 Computergrafiekset 1-inleiding Jack van Wijk TU/e

  2. Computergrafiek • Doel: Kennis over en ervaring met basisconcepten 2D en 3D computergrafiek • Vorm: colleges, instructies • Beoordeling: tentamen, opdracht

  3. Colleges 15 stuks (max.) • Overzicht van stof • Details (m.n. algoritmes en wiskunde) • Uitleg instructie-opgaven • Vragen! • Demo’s

  4. Instructies • Andrei Jalba en Stef van den Elzen • Oefeningen en opdracht • Vragen!

  5. Tussentoets • Halverwege (wordt nog bekend gemaakt) • Tijdens instructie • Toetsing & feedback beheersing stof • 1 bonuspunt tentamen

  6. Studiemateriaal • Boek: Donald Hearn, M. Pauline Baker, Computer Graphics with OpenGL, 3rd edition, Pearson Prentice Hall, ISBN 0-13-0120238-3 (paperback). • Studeerwijzer • Sheets • Oefeningen instructies • www.win.tue.nl/~vanwijk/2IV10

  7. College 1 • Waarom computergrafiek?

  8. Daarom! • Leuk! • Alomtegenwoordig • Visueel systeem biedt: • Parallel input • Parallel processing • Computergrafiek: ideaal voor mens-machine communicatie

  9. Graphs and charts Computer-Aided Design Virtual Reality Data Visualization Education and training Computer Art Movies Games Graphical User Interfaces Toepassingen H&B 1:2-33

  10. Business graphics H&B 1:2-33

  11. Computer-Aided Design • AutoDesk • IAME 2-stroke race kart engine

  12. Visualisatie Wetenschappelijke visualisatie Clip: Golden Age of Scientific Computing http://www.sci.utah.edu/ H&B 1:2-33

  13. Gaming H&B 1:2-33

  14. Serious gaming • VSTEP Rotterdam • www.vstep.nl

  15. expressie onscherpte breuk water haar spiegeling Animatie beweging H&B 1:2-33

  16. Hardware • Snelle ontwikkeling • Historie: zie boek • Nu: grafische kaart, LCD-scherm

  17. Gigapixel display • 50 LCD touchscreens Hardware • 24 scherm configuratie, Virginia Tech

  18. Toekomst? Head mounted displays? Parachute trainer US Navy

  19. Toekomst? • Oprolbaar scherm, Philips

  20. Toekomst? • Microsoft Surface

  21. interactie Gebruiker Schematisch Beeld af Model Beeld

  22. Ook… Computer Graphics Model Beeld Pattern Recognition Image Processing

  23. Onderwerpen • Inleiding • 2D basisalgoritmes • Transformaties • Viewing • Geometrisch modelleren • Zichtbare oppervlakken • Belichting • Interactie

  24. Van model naar beeld Model World View NDC Display Coördinaten en transformaties H&B 2-8:69-71

  25. Van model naar beeld Model World View NDC Display Cylinder: Local or modeling coordinates Geometrisch modelleren H&B 2-8:69-71

  26. Van model naar beeld Model World View NDC Display Positioneer cylinders in scene: World coordinates H&B 2-8:69-71

  27. Van model naar beeld Model World View NDC Display Kijk naar cylinders: Viewing coordinates Zichtbare oppervlakken, belichting H&B 2-8:69-71

  28. Van model naar beeld Model World View NDC Display Beeld af: Normalized Device Coordinates 1 0 1 H&B 2-8:69-71

  29. Van model naar beeld Model World View NDC Display Beeld af op display: Device Coordinates 0 1024 768 Interactie H&B 2-8:69-71

  30. Twee smaken computergrafiek • Vector graphics Beeld = verzameling lijnen, polygonen, cirkels,… Geometrisch model Exact, schaalbaar • Raster graphics Beeld = rooster van beeldpunten (pixels) Display Realistische beelden,

  31. Graphics software • Special-purpose packages • Photoshop, Powerpoint, AutoCAD, StudioMax, Maya,… • Computer-Graphics Application Programming Interfaces (CG API) • Windows API, OpenGL, VRML, Java3D, Direct3D,… H&B 2-8:69-73

  32. CG API • Set van graphics functies, te gebruiken vanuit programmeertaal • Toegang en afschermen hardware • Standaardisatie C, C++, Java, Delphi,… CG API Fortran, Pascal, … Drivers Display Input dev. Display Input dev. 1975 2000

  33. Functies • Graphics Output Primitives • Lijn, polygoon, bol, … • Attributes • Kleur, lijndikte, textuur,… • Geometric transformations • Modelling, Viewing • Belichting • Input functions H&B 2-8:69-73

  34. Software standards • GKS, PHIGS, PHIGS+ (1980-) • GL (Graphics Library, SGI) • OpenGL (early 1990s) • Direct3D (MS), Java3D, VRML,… • Excel, Mathematica, MatLab, … H&B 2-8:69-73

  35. OpenGL • 3D (en 2D) • Snel • Hardware, language, OS, company independent • OpenGL architecture review board • Breed ondersteund • Low-level (right level!) • Standaard graphics terminologie H&B 2-8:69-73

  36. Performance… • OpenGL is snel genoeg • Afhankelijk van complexiteit scene • Afhankelijk van gebruik van API • Afhankelijk van hoeveelheid communicatie met kaart (bus is soms bottleneck) bus CPU Graphics card

  37. Intro OpenGL • Paar basisprincipes • Geen tentamenstof • Wel: opdracht

  38. GLU en GLUT • OpenGL: basisfuncties • GLU(T): OpenGL Utility (Toolkit) libraries: • Koppeling met windowing system • Inputfuncties • Handige hulpfuncties voor viewing en geometrie • glutFunctie(); H&B 2-9:73-80

  39. OpenGL syntax • Functies: glFunctie: glBegin, glClear, glVertex • Constanten: GL_CONSTANT: GL_2D, GL_LINE • Datatypes: GLtype: GLbyte, GLint, GLfloat H&B 2-9:73-80

  40. Voorbeeld glClearColor(1.0,1.0,1.0,0.0);// Achtergrondkleur glMatrixMode(GL_Projection); // Zet transformatie glLoadIdentity; gluOrtho2D(0, 200, 0, 150); glClear(GL_COLOR_BUFFER_BIT); // Wis achtergrond glColor3f(1.0, 0.0, 0.0); // Zet kleur glBegin(GL_LINES); // Teken lijn glVertex2i(180, 15); // - eerste punt glVertex2i(10, 145); // - tweede punt glEnd; // Klaar met lijn glFlush; // Verstuur H&B 2-9:80

  41. OpenGL output functies glBegin(GL_iets); glVertex*(); glVertex*(); … glEnd; glVertex[234][isfd] [234]: 2D, 3D, 4D [isfd]: integer, short, float, double Bijv: glVertex2i(100, 25); H&B 3-3:89

  42. Output primitives 1 • GL_POINTS: reeks punten • GL_LINES: reeks lijnsegmenten • GL_LINE_STRIP: polyline • GL_RECT: rechthoek • GL_POLYGON: polygoon H&B 3

  43. Output primitives 2 • GL_TRIANGLES: reeks driehoeken • GL_TRIANGLE_STRIP: • GL_TRIANGLE_FAN: H&B 3

  44. Output primitives 3 • GL_QUADS: reeks vierhoeken • GL_QUAD_STRIP: H&B 3

  45. Basis wiskunde voor CG • Coördinaten • Punten en vectoren H&B A-1

  46. Coördinaten 2D Cartesische coördinaten: x y (x,y) (x,y) y x Standaard Scherm (output, input) H&B A-1

  47. Poolcoördinaten y (x,y) r  x H&B A-1

  48. 3D coördinaten 1 3D Cartesische coördinaten: (x,y,z) z (x,y,z) z x y x y Rechtshandig Linkshandig H&B A-1

  49. 3D coördinaten 2 Cylindercoördinaten: (x,y,z) z y x  H&B A-1

  50. 3D coördinaten 3 Bolcoördinaten: (x,y,z) z f r y x  H&B A-1

More Related