1 / 44

CSC 220 3D Computer Graphics Fall 2003

CSC 220 3D Computer Graphics Fall 2003. Graphics Hardware. Text Mode – Characters (2K bytes) Graphics Modes – Pixels (millions of bytes) x-y coordinate system Raster Scan with Frame Buffer (aliasing ) Vector Scan with Display List. Color for Computer Graphics.

Antony
Télécharger la présentation

CSC 220 3D Computer Graphics Fall 2003

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. CSC 220 3D Computer Graphics Fall 2003

  2. Graphics Hardware • Text Mode – Characters (2K bytes) • Graphics Modes – Pixels (millions of bytes) • x-y coordinate system • Raster Scan with Frame Buffer (aliasing) • Vector Scan with Display List

  3. Color for Computer Graphics • Red, Green, Blue phosphors and shadow mask • VGA – 640 x 480 with 16 colors • VGA – 320 x 200 with 256 colors, using the Color LookUp Table (CLUT) – 8 bits / pixel is 256 colors at one time, but 262,144 colors in palette • SVGA with True Color – 800 x 600 (or more), using 24 bits / pixel – millions of colors simultaneously

  4. Graphics Software • BASIC is an exception • API’s, or libraries Borland Graphical Interface (BGI) Graphical Kernel System (GKS) OpenGL …

  5. Graphics File Formats • GIF • JPEG • BMP • TIFF • Targa • …

  6. The Graphics Pipeline • Modeling – geometry of an object • Viewing – how the object appears hidden surfaces synthetic camera • Rendering – realism and more lighting shading textures shadows

  7. Modeling Techniques • Polygons (Triangles) • Splines (NURBS) • Constructive Solid Geometry (CSG) • Fractals …

  8. Teddy – a Modeling Applet • Simple and quick • For rough models instantly • Spherical topology • Operations creation extrusion cutting bending

  9. TERA • A tool for visual literacy • Can display 500,000 combinations of images rendered by various methods • Can be used in two ways explore rendering effects self-test rendering effects • Contains POV-Ray files also

  10. Some Visual Cues • Visibility • Shadows • Reflections • Refraction

  11. Surface Algorithms • Visibility wireframe – ambiguity hidden lines / surfaces • Rendering techniques (2 of many) z-buffer ray tracing

  12. Some Minimal Mathematics • 3D coordinates – x,y,z as LHS • Vectors – direction and magnitude • Normal vector to a surface • Culling back faces

  13. The Z-buffer Method • Along with frame buffer have a z-buffer: Frame buffer holds color value for the pixel Z-buffer holds z value for the pixel location • Scan each surface in succession. If z value for this location on this surface is less than value in z-buffer, replace color in frame buffer and update value in z-buffer • Most common rendering method, often with special hardware

  14. POV-Ray • No modeling, uses Scene Description Language (SDL) • Does viewing and rendering • No books in print, but excellent on-line documentation • Exercises from TERA text render gold.pov, p.9 render room.pov, p.20 revise camera orientation of room, pp.21,22

  15. Specifying an Image in SDL • Objects Simple shapes CSG objects Advanced shapes • Transformations • Texture • Camera • Lighting

  16. Simple Shapes • Spheres • Boxes • Cones • Cylinders • Planes

  17. Constructive Solid Geometry • Union • Intersection • Difference • Merge

  18. Transformation of Coordinates • Affine transformations translation scaling rotation • Composition of affine transformations • Properties of affine transformations straight lines stay straight parallel lines stay parallel angles do NOT stay fixed, except for rigid transformations (no scaling)

  19. Z-Buffer Shading • Constant Shading – color computed once for entire object • Faceted Shading – color computed once for each polygon • Gouraud Shading – color computed using vertex normal, then double interpolation of color values in the polygon • Phong Shading – double interpolation of vertex normals, then color value computed for each interpolated vector value in the polygon

  20. Lights in POV-Ray • Point lights • Spotlights radius falloff tightness adaptive jitter • Cylinder lights (same parameters as spotlight) • Area lights • Ambient lighting

  21. Reflected Light • When light strikes a surface, some colors are absorbed, and we see the colors that are reflected. • We deal with three types of reflections: ambient reflected light diffuse reflected light specular reflected light (Phong illumination) • Computing the reflected values requires that vectors must be multiplied.

  22. Ray Tracer Shading • Multiple reflections • Transparency • Refraction • Shadows

  23. 2D Texture Mapping • Map Types planar – normal parallel to X, Y, or Z cylindrical – rotation around X, Y, or Z spherical – rotation around X, Y, or Z box – normal parallel to X, Y, or Z • Problems poles distortion aliasing • Bilateral symmetry and planar maps

  24. 3D Texture Mapping • Procedural – texture is function f(x,y,z) • Common textures are stripes, rings, ramps • Noise for realistic effects amplitude frequency use of higher order terms eccentricity, tilt, and twist • Texture functions in POV-Ray for glass, metal, stone, and wood

  25. Viewing – the Synthetic Camera • World Coordinates (WC) – x,y,z r is location of camera in WC • The View Plane – U,V,N N is where camera is looking V is up direction, orthogonal to N U is 3rd axis, orthogonal to both N and V

  26. Light and its Perception • In describing the effects of light we must take into account both physics and physiology. • The wavelength of visible light varies from 400 nanometers (violet) to 700 nanometers (red). • In describing the quality of light, we need three parameters: hue – the dominant wavelength intensity (physics) or brightness (physiology) saturation – the purity of the hue

  27. The Human Eye • The eye has rods that are very sensitive to light versus dark (about 1 photon), and cones that are less sensitive to level (about 5 photons) but can distinguish colors. • There are cones sensitive to blue, to green, and to red. They are all in the fovea (1/4 mm), and are the basis of the tristimulus theory of vision. • Light which is a mixture of red and green looks just as yellow as does pure yellow light! The human visual system cannot detect overtones and harmonics as does the human auditory system.

  28. The Color Cubes • The primaries for additive (emitted) color in computer graphics are red, green, and blue, yielding the RGB color cube. red + green = yellow red + blue = magenta green + blue = cyan • The primaries for subtractive (reflected) color are cyan, magenta, and yellow, yielding the CMY color cube. cyan ink absorbs red magenta ink absorbs green yellow ink absorbs blue

  29. The HSV Color System • It is difficult to predict what a given mixture of RGB levels will look like. • For such a purpose, it is easier to use the HSV coordinate system based upon Hue, Saturation, and Value. • This maps to a cone or a six-sided pyramid: Hue is the angular location on the side wall Saturation is the relative distance from the center line to the color point (purity) Value is the height in the inverted cone • These can easily be thought of in more natural terms such as tints, shades, and tones.

  30. Halftoning When there are a limited number of color levels available in the output, we can trade spatial resolution for color resolution. Thus, there may be just 2 color levels (e.g. black or white). Take ‘super-pixels’ of size 2x2 or 3x3. Within a 2x2 block, there are 4 individual pixels that may or not be lit, for 5 levels of aggregate intensity in that super-pixel. To the eye, the increased color gradation is well worth the loss in spatial resolution.

  31. Some Advanced Shapes • Blobs for lumpy objects • Splines to fit to control points approximation – Bezier curves interpolation – many types of splines piecewise polynomial sections (cubics) smoothness, or continuity • NURBS – Non Uniform Rational BSplines

  32. NURBS • Non-uniform rational B-splines non-uniform – spacing of control points rational – a quotient (ratio) of polynomials also knots where kinks are desired • NURBS are good for modeling curves Just as important properties are maintained with affine transformations, so are NURBS maintained under projective transformations – so only control points need be transformed. • NURBS can model conic sections exactly!

  33. The Rhino Interface • Rhino is a modeling tool – has primitive shading and rendering capability • 3 Orthographic Viewports top, front, right views are default bottom, back, left views are also possible • 1 Perspective Viewport • 2 Toolbars, with flyouts

  34. Viewing in Rhino • Parallel or perspective projection (each viewport) • Panning • Rotating • Zooming zoom dynamic zoom extents zoom window zoom selected

  35. Drawing Lines • Line segments versus polylines • Coordinate systems absolute cartesian 3,4 relative cartesian r3,4 absolute polar 5<60 relative polar r5<60

  36. Modeling Aids • Snap to grid • Ortho • Object Snaps • Layers • Constraints distance constraint 5 angle constraint <60

  37. Editing Objects • Split and Trim • Join and Explode • Fillet • Chamfer • Transforms scale rotate mirror

  38. Rhino Geometry • Points • Curves • Surfaces • Polysurfaces – blended surfaces • Solids – closed polysurfaces

  39. Creating Curves • Free-form control points – Bezier curves (for approximation) interpolate points – spline curves (for interpolation) sketch • Conic sections • Polygons

  40. Creating Surfaces • From points • From curves • Extrusion • Lofting • Revolves • Rail sweeps

  41. Creating Solids • Box • Sphere • Cylinder • Tube • Cone • Ellipsoid • Torus

  42. Technical Side of Animation • The Storyboard • Keyframes • Inbetween frames for shape (morphing) for motion • Motion capture • Physical modeling

  43. Artistic Side of Animation • Stretch and Squash • Timing • Anticipation • Staging • Slow In and Out • Emotion

More Related