Lec3b Theory in Computer Graphics

Embed Size (px)

Citation preview

  • 8/22/2019 Lec3b Theory in Computer Graphics

    1/28

    Principles of Computer Graphics

    Lecture 3 1

  • 8/22/2019 Lec3b Theory in Computer Graphics

    2/28

    Why we learn computer graphics?

    Appreciate what we see

    to develop specific engineering program

    that re uires com uter ra hics

    Some of theories computer graphics hasengineering applications

    Trend: Engineering Computer GraphicGroup under Faculty of ME in UT, Austin

    Lecture 3 2

  • 8/22/2019 Lec3b Theory in Computer Graphics

    3/28

    Definition of Computer Graphics

    e ers o any compu er ev ce orprogram that makes a computer

    manipulating pictures. (Webopedia)

    creation, storage and manipulation of

    Lecture 3 3

  • 8/22/2019 Lec3b Theory in Computer Graphics

    4/28

    Computer Graphics

    i. Interactive

    ii. Clipping

    iii. Projectioniv. Hidden line or surface removal

    Lecture 3 4

  • 8/22/2019 Lec3b Theory in Computer Graphics

    5/28

    i. Interactive Computer Graphics

    First interactive graphicssystem, Sketchpad, by IvanSutherland

    Note: using CRT monitor, lightpen and function-key panel

    Lecture 3 5

  • 8/22/2019 Lec3b Theory in Computer Graphics

    6/28

    Interactive Computer Graphics

    Touch Screen on PDA

    HP I-PaqTM Wii by Nintendo

    Virtual Sphere

    Lecture 3 6

  • 8/22/2019 Lec3b Theory in Computer Graphics

    7/28

    Desktop

    Semi Immersive

    Fully Immersive

    e.G CAVE

    Lecture 3 7

  • 8/22/2019 Lec3b Theory in Computer Graphics

    8/28

    Menu and Icon: Interactive

    Microsoft word with all themenu

    Lecture 3 8

  • 8/22/2019 Lec3b Theory in Computer Graphics

    9/28

    UI Fact

    ompu er spee ncreases owever uman oesn .

    Human Computer Interface Research Center

    Human Interface Technolo Lab Universit of Washin ton

    Group for User Interface Research (UC Berkeley)Human Computer Interaction Institute (Carnegie Mellon)Graphics, Visualization, and Usability Center (Georgia Tech)

    Lecture 3 9

  • 8/22/2019 Lec3b Theory in Computer Graphics

    10/28

    Cool fact on UI

    90/10 rule

    10% of the features using90% of the time

    Xerox-First developed mouse

    -First developed personnel workstation- rs eve ope over app ng mu w n ows

    1985, famous lawsuit, Apple vs. Microsoft overWindows use of icons ointers etc.

    Microsoft Windows is considered as a Mac imitationwith minimal improvements

    Lecture 3 10

  • 8/22/2019 Lec3b Theory in Computer Graphics

    11/28

    Computer Graphics

    o crea e rea sm n v sua za on.

    i. Interactive

    ii. Clipping

    iii. Projectioniv. Hidden line or surface removal

    Lecture 3 11

  • 8/22/2019 Lec3b Theory in Computer Graphics

    12/28

    ii. Clipping

    Lecture 3 12

  • 8/22/2019 Lec3b Theory in Computer Graphics

    13/28

    Clipping cont

    oog e ear , ren er ng scarried out when we view on certain

    Why? Save memory allocation whenonl view ort is rendered or dis la ed

    Problem: display actual shape anddis la sha e

    Technique: display the visible partand discard the invisible art

    Lecture 3 13

  • 8/22/2019 Lec3b Theory in Computer Graphics

    14/28

    Clipping Technique

    amous ec n que: o en an ut er an

    Principle:Edges of the screen is extended to form nineregions. The central region will be the entitiesto be dis la ed.

    Polygon: extra line is created

    Curves: breaking the curves into segments ofstraight lines

    Lecture 3 14

  • 8/22/2019 Lec3b Theory in Computer Graphics

    15/28

    010100011001

    e proce ure w exam ne e ver ces o

    the lines using four bits codeb3 b2 b1 b0

    D C

    If TRUE bits = 1

    b3 = ( x < xmin) vertex to the left of ADDisplay0000

    1000b2 = ( x > xmax) vertex to the right of BC

    b1 = (y < ymin) vertex below AB

    b0 = > max vertex above CD

    01100010

    1010

    Lecture 3 15

  • 8/22/2019 Lec3b Theory in Computer Graphics

    16/28

    3D Clipping

    011010011001 011000

    001010001001 001000

    101010101001 101000

    010110010100010101 000110000100000101 100110100100100101

    eg ons

    6 bit outcode records results of four bounds tests:First bit: outside back plane, behind back plane

    econ : ou s e ron p ane, n ron o ron p aneThird bit: outside top plane, above top planeFourth bit: outside bottom plane, below bottom planeFifth bit: outside right plane, to right of right plane

    Lecture 3 16

    x : ou s e e p ane, o e o e p ane

  • 8/22/2019 Lec3b Theory in Computer Graphics

    17/28

    Computer Graphics

    o crea e rea sm n v sua za on.

    i. Interactive

    ii. Clipping

    iii. Projectioniv. Hidden line or surface removal

    Lecture 3 17

  • 8/22/2019 Lec3b Theory in Computer Graphics

    18/28

    iii. Type of projection

    ara e ro ec on:

    Used by engineer for measurement

    erspec ve ro ec on:

    Imitates eyes or camerato look more natural

    SCREEN

    SCREEN

    Lecture 3 18

  • 8/22/2019 Lec3b Theory in Computer Graphics

    19/28

    Projection in games

    in games since it first used in 1982

    Lecture 3 19

  • 8/22/2019 Lec3b Theory in Computer Graphics

    20/28

    Computer Graphics

    o crea e rea sm n v sua za on.

    i. Interactive

    ii. Clipping

    iii. Projectioniv. Hidden line or surface removal

    Lecture 3 20

  • 8/22/2019 Lec3b Theory in Computer Graphics

    21/28

    iv. Hidden line & Surface Removal

    -

    invisibleback face

    invisible

    back face

    visible

    visible

    Lecture 3 21

  • 8/22/2019 Lec3b Theory in Computer Graphics

    22/28

    iii. Hidden line & Surface Removal-cont

    - ep

    sorting all the faces (polygons) in thescene accor ng o e arges z

    coordinate value of each.

    Lecture 3 22

  • 8/22/2019 Lec3b Theory in Computer Graphics

    23/28

    iii. Hidden line & Surface Removal-cont

    0y)f(x,

    222=

    =Eq of the circle

    tdPQ +=

    Lets say eye point P = (-3,1) withVector direction of (0.8, -0.6)

    .,.,.,

    Therefore 096

    0)(

    2=+

    =

    tt

    Qf

    imaginary answer: no intersectionOne answer: tangent to the circle, visible pointTwo answer: two points,

    Lecture 3 23

    one v s e, one en

  • 8/22/2019 Lec3b Theory in Computer Graphics

    24/28

    Computer Graphics

    o crea e rea sm n v sua za on.

    i. Interactive

    ii. Clipping

    iii. Projectioniv. Hidden line or surface removal

    Lecture 3 24

  • 8/22/2019 Lec3b Theory in Computer Graphics

    25/28

    v. Surface detail and texture

    Point light source: provide shine on surface Ambient li ht: a li ht with uniform

    brightness

    Lecture 3 25

  • 8/22/2019 Lec3b Theory in Computer Graphics

    26/28

    Illumination

    faces called polygon, each patchhas its own normal and centeroint.

    The basic principle ofillumination is light rays will

    strike on each patch and the

    specular

    ig t wi e a sor e , re ecteor scattered.

    Realism can be achieved by the

    diffuse

    ambient

    ambient light

    Lecture 3 26

  • 8/22/2019 Lec3b Theory in Computer Graphics

    27/28

    Shading

    Basic principle: each vertex on theol on has its own color. The color

    will be interpolated as they movetoward center of the polygon

    Flat shading: same color across the polygon Gourand shading: lights are computed at its vertices and

    Phong lighting model: linearly interpolate a normal vector Nacross the polygon on from the normal on each vertex and it isdone for each pixel in the polygon. Then color the pixel

    Lecture 3 27

    .

  • 8/22/2019 Lec3b Theory in Computer Graphics

    28/28

    Texture mapping

    .

    mapping is similar to process of applying patternedpaper to the object. 3D texture mapping is analogousto cravin rocess.

    Visual affect or illusion is used to create realism suchsense of depth.

    iClone

    Lecture 3 28