CSC 220 3D Computer Graphics Fall 2003 - PowerPoint PPT Presentation

About This Presentation
Title:

CSC 220 3D Computer Graphics Fall 2003

Description:

hidden surfaces. synthetic camera. Rendering realism and more. lighting. shading. textures ... N is where camera is looking. V is up direction, orthogonal to N ... – PowerPoint PPT presentation

Number of Views:98
Avg rating:3.0/5.0
Slides: 45
Provided by: Mathematic52
Learn more at: http://people.uncw.edu
Category:

less

Transcript and Presenter's Notes

Title: CSC 220 3D Computer Graphics Fall 2003


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
  • APIs, 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
(No Transcript)
9
Teddy a Modeling Applet
  • Simple and quick
  • For rough models instantly
  • Spherical topology
  • Operations
  • creation
  • extrusion
  • cutting
  • bending

10
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

11
Some Visual Cues
  • Visibility
  • Shadows
  • Reflections
  • Refraction

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

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

14
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

15
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

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

17
Simple Shapes
  • Spheres
  • Boxes
  • Cones
  • Cylinders
  • Planes

18
Constructive Solid Geometry
  • Union
  • Intersection
  • Difference
  • Merge

19
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)

20
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

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

22
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.

23
Ray Tracer Shading
  • Multiple reflections
  • Transparency
  • Refraction
  • Shadows

24
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

25
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

26
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

27
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

28
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.

29
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

30
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.

31
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.

32
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 B Splines

33
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!

34
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

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

36
Drawing Lines
  • Line segments versus polylines
  • Coordinate systems
  • absolute cartesian 3,4
  • relative cartesian r3,4
  • absolute polar 5
  • relative polar r5

37
Modeling Aids
  • Snap to grid
  • Ortho
  • Object Snaps
  • Layers
  • Constraints
  • distance constraint 5
  • angle constraint

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

39
Rhino Geometry
  • Points
  • Curves
  • Surfaces
  • Polysurfaces blended surfaces
  • Solids closed polysurfaces

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

41
Creating Surfaces
  • From points
  • From curves
  • Extrusion
  • Lofting
  • Revolves
  • Rail sweeps

42
Creating Solids
  • Box
  • Sphere
  • Cylinder
  • Tube
  • Cone
  • Ellipsoid
  • Torus

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

44
Artistic Side of Animation
  • Stretch and Squash
  • Timing
  • Anticipation
  • Staging
  • Slow In and Out
  • Emotion
Write a Comment
User Comments (0)
About PowerShow.com