cgt 215 computer graphics programming i
play

CGT 215 Computer Graphics Programming I Introduc9on CGT - PowerPoint PPT Presentation

CGT 215 Computer Graphics Programming I Introduc9on CGT 215 Programming fundamentals Logic Problem solving Provides the basis for developing


  1. CGT ¡215 ¡ Computer ¡Graphics ¡Programming ¡I ¡ Introduc9on ¡

  2. CGT ¡215 ¡ • Programming ¡fundamentals ¡ • Logic ¡ • Problem ¡solving ¡ • Provides ¡the ¡basis ¡for ¡developing ¡object-­‑oriented ¡ applica9ons ¡ ¡ • How ¡to ¡write, ¡compile, ¡build, ¡and ¡debug ¡GRAPHICS ¡ applica9ons. ¡ ¡

  3. Course ¡Philosophy ¡ • Teach ¡programming ¡through ¡graphics ¡ • Design ¡& ¡Visualiza9on ¡ • Interac9vity ¡ • Experimenta9on ¡ • Learn ¡by ¡doing ¡5 ¡projects ¡ Processing ¡IDE ¡

  4. Family ¡Tree ¡ Image ¡from ¡“GeQng ¡started ¡with ¡Processing” ¡

  5. Course ¡Textbook ¡

  6. Why ¡Programming? ¡

  7. VIC ¡20, ¡my ¡first ¡computer ¡c. ¡1988 ¡ Computer ¡ar+st , ¡from ¡“Computer ¡graphics ¡with ¡OpenGL” ¡ LOGO ¡

  8. Basic ¡Heart. ¡ ¡1999 ¡

  9. In ¡and ¡Out. ¡ Collabora9on ¡with ¡Max ¡Carlson ¡

  10. Why ¡Programming? ¡ Assignment ¡1 ¡ Why ¡do ¡you ¡want ¡to ¡learn ¡computer ¡graphics ¡ programming? ¡ – Type ¡up ¡in ¡one ¡or ¡two ¡paragraphs. ¡ ¡ – Submit ¡on ¡blackboard ¡ ¡

  11. ? ¡

  12. Joshua ¡Davis ¡ ¡ h]ps://www.behance.net/joshuadavis ¡ ¡

  13. Marius ¡Watz ¡ ¡ h]ps://www.flickr.com/photos/watz ¡ ¡

  14. Rafael ¡Rozendaal ¡ ¡ h]p://www.newrafael.com/ ¡ ¡

  15. Why ¡Programming ¡ We ¡are ¡data ¡ (Data ¡trails) ¡ Big ¡Data ¡ Cyberne9cs ¡ h]p://vimeo.com/91054550 ¡ ¡ Digital ¡Fabrica9on ¡ Core ¡competency ¡ Simula9on ¡ Parametric ¡Design ¡

  16. CGT ¡215 ¡ Geometric ¡Primi9ves ¡

  17. Geometric ¡primi9ves ¡ • Point ¡ • Line ¡ • Shape ¡ • Curve ¡ • Polygon ¡ • Plane ¡

  18. Cartesian ¡coordinate ¡system ¡

  19. Polygons ¡

  20. Circle ¡ • r 2 = ¡x 2 +y 2 ¡

  21. Composite ¡shapes ¡ + ¡ = ¡ = ¡

  22. Composite ¡shapes ¡ = ¡ -­‑ ¡

  23. Vector ¡Graphics ¡ Vector ¡graphics ¡is ¡the ¡use ¡of ¡geometrical ¡ primi9ves ¡such ¡as ¡points, ¡lines, ¡curves, ¡and ¡ shapes ¡or ¡polygon(s), ¡which ¡are ¡all ¡based ¡on ¡ mathema9cal ¡expressions, ¡to ¡represent ¡images ¡ in ¡computer ¡graphics. ¡

  24. Project ¡1:Vector ¡primi9ves ¡ • Design ¡an ¡abstract ¡composi9on ¡using ¡the ¡geometric ¡ primi9ves ¡(See ¡geometric ¡abstrac9on ¡examples). ¡ • Use ¡points, ¡lines, ¡shapes, ¡curves ¡and ¡at ¡least ¡4 ¡values ¡to ¡ produce ¡an ¡aesthe9cally ¡pleasing ¡image ¡in ¡the ¡ Processing ¡ programming ¡environment. ¡ ¡ • Use ¡the ¡func9ons ¡explained ¡in ¡Chapter ¡3 ¡(Reas ¡& ¡Fry, ¡2010) ¡

  25. Assignment ¡2 ¡

  26. Project ¡1 ¡ • Vector ¡primi9ves ¡

  27. CGT ¡215 ¡ Computer ¡Graphics ¡Programming ¡I ¡ Variables ¡

  28. Variables ¡ Data ¡type ¡ Meaning ¡ Value ¡range ¡ Int ¡ Whole ¡numbers ¡ -­‑2,147 ¡Million ¡to ¡2,147 ¡Million ¡ float ¡ Floa9ng ¡point ¡(decimals) ¡ 3.40282347E+38 ¡to ¡-­‑3.40282347E+38 ¡ ¡ boolean ¡ T ¡F ¡statements ¡ True ¡or ¡False ¡ string ¡ Store ¡words ¡or ¡sentences ¡ “for ¡example…” ¡ color ¡ Store ¡colors ¡ ~ ¡17 ¡Million ¡

  29. Assignment ¡3 ¡ On ¡a ¡white ¡piece ¡of ¡paper, ¡ sketch ¡a ¡flow ¡diagram ¡of ¡ your ¡morning ¡rou9ne. ¡Be ¡as ¡ detailed ¡as ¡possible. ¡

  30. CGT ¡215 ¡ Computer ¡Graphics ¡Programming ¡I ¡ If… ¡else ¡

  31. CGT ¡215 ¡ Computer ¡Graphics ¡Programming ¡I ¡ And ¡-­‑ ¡Or ¡

  32. Rela9onal ¡Operators ¡ > ¡ Greater ¡than ¡ < ¡ Less ¡than ¡ >= ¡ Greater ¡than ¡or ¡equal ¡to ¡ <= ¡ Less ¡than ¡or ¡equal ¡to ¡ == ¡ Equality ¡ != ¡ Inequality ¡

  33. Logical ¡Operators ¡ || ¡ Logical ¡OR ¡ && ¡ Logical ¡AND ¡ ! ¡ Logical ¡NOT ¡

  34. Expression ¡(test) ¡ Result ¡ ( ¡5 ¡== ¡4) ¡ False ¡ ( ¡5 ¡== ¡5) ¡ True ¡ !(23 ¡< ¡50) ¡ False ¡ (23 ¡> ¡3) ¡&& ¡(23 ¡< ¡8) ¡ False ¡ (23 ¡> ¡3) ¡|| ¡(23 ¡< ¡8) ¡ True ¡

  35. Image ¡from ¡Reas ¡& ¡Fry: ¡“GeQng ¡started ¡with ¡Processing” ¡

  36. Image ¡from ¡Reas ¡& ¡Fry: ¡“GeQng ¡started ¡with ¡Processing” ¡

  37. Image ¡from ¡Reas ¡& ¡Fry: ¡“GeQng ¡started ¡with ¡Processing” ¡

  38. CGT ¡215 ¡ Computer ¡Graphics ¡Programming ¡I ¡ Loops ¡

  39. Image ¡from ¡Reas ¡& ¡Fry: ¡“GeQng ¡started ¡with ¡Processing” ¡

  40. CGT ¡215 ¡ Computer ¡Graphics ¡Programming ¡I ¡ Geometric ¡Transforma9ons ¡

  41. Image ¡from ¡Reas ¡& ¡Fry: ¡“GeQng ¡started ¡with ¡Processing” ¡

  42. Image ¡from ¡Reas ¡& ¡Fry: ¡“GeQng ¡started ¡with ¡Processing” ¡

  43. Image ¡from ¡Reas ¡& ¡Fry ¡

  44. Image ¡from ¡Reas ¡& ¡Fry: ¡“GeQng ¡started ¡with ¡Processing” ¡

  45. Project ¡2 ¡ Recreate ¡the ¡one ¡or ¡more ¡ mail ¡envelope ¡pa]erns ¡ provided ¡in ¡the ¡a]ached ¡ PDF. ¡You ¡may ¡use ¡ For ¡loops , ¡ If ¡statements ¡ or ¡ geometric ¡ transforma@ons ¡to ¡produce ¡ a ¡visual ¡output ¡that ¡ resembles ¡the ¡original ¡ pa]ern. ¡

  46. CGT ¡215 ¡ Computer ¡Graphics ¡Programming ¡I ¡ Digital ¡Images ¡

  47. Raster Images • Have a given resolution • Consist of pixels • Photorealistic Examples: JPG, GIF, TIF, BMP, PNG (different types of compression)

  48. Vector Images • A database of 2D objects • Have no fixed resolution • Does not consist of pixels • Can be scaled arbitrarily • Graphics stored as algorithms • Simplified as geometric elements-objects Examples: PDF, SWF, clip arts, SVG, AI

  49. CGT ¡215 ¡ Computer ¡Graphics ¡Programming ¡I ¡

  50. white tint gray tone hue shade black

  51. Color Systems in CG • RGB • CMY+K • HLS or HSB or HSV • Lab • Color is a 3D system!

  52. Pixels and values

  53. RGB • Additive system • Reference to value of Pixels • 0 to 255 • Hex is subset of RGB: #0000FF • Screen color, web

  54. CMYK • Substractive system • Reference to pigments • % • Print • Add “ K ”

  55. CMYK dot

  56. HSV • Intuitive • Easy to find • degrees, % • Hue, Saturation, Value • Also called HSB, HLS

  57. RGB , CMYK & HSV

  58. CGT ¡215 ¡ Computer ¡Graphics ¡Programming ¡I ¡ Mouse ¡& ¡Keyboard ¡ ¡ Inputs ¡

  59. ? ¡

  60. Mouse ¡ ¡ mouseBu]on ¡ mouseClicked() ¡ mouseDragged() ¡ mouseMoved() ¡ mousePressed() ¡ mousePressed ¡ mouseReleased() ¡ mouseWheel() ¡ mouseX ¡ mouseY ¡ pmouseX ¡ pmouseY ¡

  61. Keyboard ¡ key ¡ keyCode ¡ keyPressed() ¡ keyPressed ¡ keyReleased() ¡ keyTyped() ¡

  62. CGT ¡215 ¡ Computer ¡Graphics ¡Programming ¡I ¡ Func9ons ¡

  63. Project ¡3: ¡ “Carnival ¡Ride” ¡ Create ¡a ¡program ¡that ¡simulates ¡a ¡ carnival ¡ride ¡that ¡is ¡controlled ¡by ¡the ¡ user. ¡ Your ¡program ¡must ¡use ¡the ¡following ¡ elements: ¡ Geometric ¡Transforma9ons ¡ • (Rotate, ¡Scale) ¡ on/off ¡states, ¡backwards ¡ ¡ • Import ¡Raster/Vector ¡images ¡ •

  64. Assignment ¡4 ¡ Concept ¡brief: ¡ • What ¡are ¡you ¡going ¡to ¡do ¡for ¡ project ¡3? ¡ ¡ • What ¡kind ¡of ¡programming ¡ elements ¡will ¡you ¡be ¡using? ¡ ¡ • How ¡will ¡you ¡create ¡your ¡ images? ¡ • Interac@vity : ¡What ¡will ¡trigger ¡ the ¡different ¡behaviors? ¡

  65. CGT ¡215 ¡ Computer ¡Graphics ¡Programming ¡I ¡ Func9ons ¡

  66. Func9ons ¡ • Also ¡called ¡Methods, ¡ Subrou9nes, ¡Subprograms ¡ • A ¡program ¡inside ¡a ¡program ¡ • User-­‑defined ¡or ¡Language ¡ defined ¡ • Can ¡return ¡values ¡but ¡it ¡ doesn’t ¡have ¡to ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend