CSCI 346 - PowerPoint PPT Presentation

About This Presentation
Title:

CSCI 346

Description:

n e x t. h o m e. Agenda. Homework - assignment 2 is due Friday 02/01/2002 ... n e x t. h o m e. Lens. Focus the incoming light on the retina, which contains ... – PowerPoint PPT presentation

Number of Views:136
Avg rating:3.0/5.0
Slides: 44
Provided by: csU50
Learn more at: https://www.cs.unca.edu
Category:
Tags: csci

less

Transcript and Presenter's Notes

Title: CSCI 346


1
CSCI 346
  • Chapter 1 and Chapter 2
  • Graphics Systems and Models
  • And Graphics Programming

2
Agenda
  • Homework - assignment 2 is due Friday 02/01/2002
  • Finish chapter 1 and start chapter 2

3
Homework 2
  • Convert your 2D object from program 1 to a 3D
    object.
  • Center it well in your 3D window.
  • Use a meaningful window name (not "Susan's
    picture").
  • Remember to document your code.
  • Movement is not required for this assignment.
  • Review your code before you submit it. If you see
    repeated chunks of code, create a function and
    use it.
  • Display it using an orthographic projection.
  • Use my program named 3D picture linked from the
    bottom of the syllabus as a guide.
  • This programs source code is due before next
    weeks class 02/01/2002.

4
glOrtho (GLdouble left, GLdouble right,
GLdouble, bottom, GLdouble top, GLdouble near,
GLdouble far)
  • Creates a viewing volume with a box shape.
  • Direction of projection is parallel to z axis.
  • Viewpoint faces -z axis.
  • glOrtho (0.0, (GLdouble) w, 0.0,
    (GLdouble) h, -500.0, 500.0)

5
(No Transcript)
6
Imaging Systems
  • The human vision system
  • Pinhole camera
  • Synthetic camera model

7
The Human Vision System
  • Very complex
  • Light enters the eye through the lens and the
    cornea
  • Iris opens and closes to regulate amount of light
  • Lens forms an image on the retina
  • Rods and cones are on the retina and are the
    light sensors and excitable by the visible light
    spectrum

8
Color
  • Color results from the interaction of light with
    the nervous system
  • Lens
  • Retina
  • Color processing unit along the optic nerve

9
Lens
  • Focus the incoming light on the retina, which
    contains the photo receptors
  • Lens must adjust to the focal length of the
    wavelength
  • Red has the longest focal length
  • Blue has the shortest focal length

10
Lens
  • Focus the incoming light on the retina, which
    contains the photo receptors
  • Chromostereopsis
  • Lens absorbs light, (blue 2x red)
  • Fluid between the lens and the retina also absorb
    light

11
Retina
  • Photo receptors that absorb photons and transmit
    chemical signals to the brain.
  • Rods.
  • Night-vision receptors.
  • No color dependency.
  • Cones.
  • Color senstitivity.
  • Require a higher level of light intensity than
    the rods.
  • Clustered in the center of retina,

12
Retina
  • We see objects by edge detection, where an edge
    can be created by a difference in color or
    brightness or both.
  • Photoreceptors adjust their sensitivity to the
    overall light level.
  • There is also a required minimum intensity level
    for the photoreceptors to respond.

13
The Human Vision System
  • Resolution
  • The measure of what size objects we can see
  • How close we can place two points and they remain
    distinct
  • Intensity
  • Physical measure of light energy
  • Brightness
  • Measure of how intense we perceive the light to be

14
The Human Vision System
  • VERY complex
  • Automatic and instantaneous
  • Pattern recognition
  • Depth perception

15
Pinhole Camera
  • Simple model
  • Box
  • Small pin hole at one side
  • Film at the opposite side

16
Pinhole Camera
  • Field or angle of view of the camera is the angle
    made by the largest object that our camera can
    image on its film plane
  • Ideal pinhole camera has an infinite depth of
    view -- every point in the field of view is in
    focus

17
Pinhole Camera
  • Problems with pinhole camerathe pinhole
  • The pinhole
  • Cannot adjust field of view

18
Sophisticated Cameras
  • Lens replaces a pinhole
  • Larger lenses admit more light
  • Choosing a lens with the proper focal length
  • Equiv to choosing d for the pinhole camera
  • The angle of view can vary up to 180 degrees
  • Objects in the field of view may or may not be in
    focus

19
The Synthetic Camera Model
  • Equivalent views of image formation

20
The Synthetic Camera Model
  • Imaging system in figure 1.17bellows camera
  • Object and viewer are specified separately

21
The Synthetic Camera Model
  • Image or projection plane in front of the lens
  • Image of the point on the object is located where
    the projector passes through the projection plane
  • Limited size of the image
  • Angle of view describes the limitation
  • A clipping rectangle placed in the image plane to
    limit the size of the image
  • Blinders on a horse
  • Underwater goggles
  • Window into the world

22
Computer Graphics Programmers Interface
  • Paint program
  • User friendly interface
  • Point and click, no programming
  • Application programmers interface (API)
  • Interface between an application program and a
    graphics system can be specified by graphics
    functions that reside in a graphics library.
    Specs called API

23
Computer Graphics API - Specify
  • Objects
  • Vertices
  • Set of primitives
  • Viewer position
  • Center of projection (center of the lens)
  • Orientation -- may be rotated about the origin
    (center of projection or center of the lens)
  • Focal length - the size of the image on the film
    plane
  • Film plane -- back of the camera has a height
    and width

24
A Sequence of Images
  • Line drawing of a scene
  • wireframe
  • Flat shading
  • One light source flat shading
  • One light source smooth shading
  • Texture

25
Modeling and Rendering
  • Modeling
  • Rendering
  • Sometimes it is good to separate the modeling of
    a scene from the production of the file (example
    ray tracing)

26
Pipeline Architectures
  • Pipeline architectures
  • Benefit
  • Translates well to computer graphics
  • Four steps to producing an image
  • Transformer
  • Clipper
  • Projector
  • rasterizer

27
Chapter 2
  • Graphics Programming

28
Sierpinski Gasket
  • Pre-Mandelbrot classic
  • Found by W. Sierpinski around world war I
  • Generated by recursively dividing a triangle into
    four congruent smaller triangles
  • Think of the interior triangles as "holes
  • They occupy more and more of the total area,
    while the "solid" portion becomes as hopelessly
    fragile

29
Pseudocode
  • 1. Pick a point at random inside the triangle
  • 2. Select one of the three vertices at random
  • 3. Find a point halfway between the initial
    point and the randomly selected vertex
  • 4. Display this new point by putting some sort
    of marker, such as a small circle, at its
    location
  • 5. Replace the initial point with this new point
  • 6. Return to step 2

30
Pen Plotter
  • moveto(x,y)
  • lineto(x,y)

31
Problems With Pen-plotter Model
  • 3D difficult
  • Must convert 3d world to 2d projection explicitly
  • OpenGL allows us to focus on building 3D world
    and let computer handle projections

32
Display Funtion
  • void display( void )
  • typedef GLfloat point22 / define a point
    data type /
  • point2 vertices30.0,0.0,250.0,500.0,50
    0.0,0.0
  • / A triangle /
  • int i, j, k
  • long rand() / standard random number
    generator /
  • point2 p 75.0,50.0 / An arbitrary
    initial point / glClear(GL_COLOR_BUFFER_BIT)
    /clear the window /
  • / computes and plots 5000 new points /
  • for( k0 klt5000 k)
  • jrand()3 / pick a vertex at random /
  • / Compute pt halfway between vertex and
    old point /
  • p0 (p0verticesj0)/2.0
  • p1 (p1verticesj1)/2.0
  • / plot new point /
  • glBegin(GL_POINTS)
  • glVertex2fv(p)
  • glEnd()
  • glFlush() / clear buffers /

33
Coordinate System
3D COORDINATE SYSTEMS
Y
Y
Z
X
X
LEFT HANDED
RIGHT HANDED
Z
34
Coordinate System in OpenGL
  • What units are x, y, and z?
  • Your choice
  • Device independent
  • World coordinate system
  • Before displaying on output device, world
    coordinates must be converted to device or raster
    or screen coordinates

35
Point To Remember
  • We are studying computer graphics
  • We are not studying OpenGL
  • Wont cover all functions in OpenGL

36
Graphics System As a Black Box
Function Calls
Output
User Program
Graphics System
Input/Output Devices
Data
Input
37
API Functions
  • Primitive functions
  • Attribute functions
  • Viewing functions
  • Transformation functions
  • Input functions
  • Control functions

38
3 D Gasket
  • Use tetrahedons

39
OpenGL - What Is It?
  • A graphics rendering library
  • API to produce high-quality, color images from
    geometric and raster primitives
  • Window system and operating system independent
  • OpenGL doesnt do windows

40
OpenGL
  • Most widely adopted graphics standard
  • Introduced in 1992
  • High visual quality and performance
  • Industry standard
  • Stable
  • Reliable and portable
  • Evolving
  • Scalable
  • Easy to use
  • Well-documented

41
Related APIs
  • GLU (OpenGL utility library)
  • Guaranteed to be available
  • tesselators
  • Quadrics
  • NURBs, etc
  • Some surprisingly common operations, such as
    projection transformations (such as
    gluPerspective)

42
Related APIs
  • GLX or WGL
  • Bridge between window system and OpenGL
  • Glut
  • Portable bridge between window system and OpenGL
  • Not standard, but uniformly popular

43
Homework
  • Finish reading chapter 2 - ICG
  • Graphics programming
  • Assignment 2 - program due 02/01/2002
Write a Comment
User Comments (0)
About PowerShow.com