1 / 16

How to get a perfect score

How to get a perfect score. By Johnny Ho. Why get a perfect score?. Free Gold Medal Pride Beat Gennady Korotkevich 2009-2011: 1st place 2012: 2nd place Fame Get Interviewed Get mentioned at rallies (but don't go and play frisbee outside instead) GIRLS

evonne
Download Presentation

How to get a perfect score

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. How to get a perfect score By Johnny Ho

  2. Why get a perfect score? • Free Gold Medal • Pride • Beat Gennady Korotkevich • 2009-2011: 1st place • 2012: 2nd place • Fame • Get Interviewed • Get mentioned at rallies (but don't go and play frisbee outside instead) • GIRLS • Many, many girls will be gazing at your face all day • You will need a priority queue to handle them all • Johnny Ho has many many girls.

  3. Computer graphics the actual meeting topic

  4. How to draw a point • Fill in a pixel: • *applause*

  5. How to draw on an LCD screen • Most LCDs come with three channels • Mix the red, green, and blue channels to make colors

  6. How to draw a line segment • Imagine the bounding box of the line segment • Take the maximum of the two dimensions • Sweep across that dimension and fill in the corresponding pixel

  7. How to draw a polygon • To be lazy, first decompose into triangles • How to draw a triangle: • Sweep across y coordinate and fill in points that lie within left and right intersection • Round x coordinates properly to avoid aliasing

  8. How to draw text (very trickily) • Remember this? • Take advantage of subpixel structure • Calibri 8pt, zoomed in: • Microsoft ClearType • ~3x horizontal resolution • Variation in color is largely undetectable by human eye

  9. How to draw a 3d object • Again, first decompose into triangles • Give each triangle a color depending on angle towards light source • How to draw a 3D triangle: • Apply a perspective transformation • Basically, just divide x and y coordinates by z coordinate to obtain x' and y' coordinates • Then draw 2d triangle

  10. Demo • Link • [code not included because of ugliness] • Z-buffering • Save Z coordinate as well as actual colors • Determine which pixels of the object are closer to camera • Interpolation • Interpolate between the three points of each triangle to improve smoothness

  11. Phong shading • Adds a specular layer • Previously named techniques only incorporate diffuse • Results in plastic texture

  12. Shadow maps

  13. Soft shadows

  14. Raytracing Credits to http://users.softlab.ntua.gr/~ttsiod/renderer.html for his amazing renderer/raytracer

  15. Solution to last week's PotW Find # common factors = # factors of gcd int ans=0, g=gcd(n, m); for(int i=1;i*i<=g;i++) { if(g%i==0) { ans+=2; if(i*i==g) ans--; } } return ans; public int gcd(int a, int b) { return b==0 ? a : gcd(b, a%b); }

  16. PotW • Go home and search up more awesome computer graphics stuff! :D • (no, you don't actually get points for this)

More Related