Top Banner
INT 840E Computer graphics Introduction & Graphic’s Architecture
21

INT 840E Computer graphics Introduction & Graphic’s Architecture.

Jan 04, 2016

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: INT 840E Computer graphics Introduction & Graphic’s Architecture.

INT 840EComputer graphics

Introduction & Graphic’s Architecture

Page 2: INT 840E Computer graphics Introduction & Graphic’s Architecture.

Computer graphics

The art of producing images and animations in the computer.

This includes the software and hardware that generates images.

Page 3: INT 840E Computer graphics Introduction & Graphic’s Architecture.

Application: The object is an artist’s rendition of the sun for an animation to be shown in a domed environment (planetarium)

Software: Graphics are built on top of a software e.g OpenGL

Hardware: PC with graphics card for modeling and rendering

Page 4: INT 840E Computer graphics Introduction & Graphic’s Architecture.

Model: An mathematical representation of a scene suitable for graphical representation. A scene can be represented in shapes, texture, layout and material.

Rendering: Projecting the objects (perspective), handling visibility(identifying which parts to be hidden) and computing their appearance and lighting interactions.

Pixel: Discrete representation of picture elements which determines the image resolution.

Page 5: INT 840E Computer graphics Introduction & Graphic’s Architecture.

Components of Computer Graphics

Modeling: Defining objects in terms of primitives, coordinates and characteristics

Storing: Storing scenes and images in memory and on disk

Manipulating: Changing the shape, position and characteristics of objects

Viewing: Displaying images from various viewpoints on various devices

Page 6: INT 840E Computer graphics Introduction & Graphic’s Architecture.

The coordinate systems

OpenGL places the origin in the lower left corner of the screen

The coordinate system is defined by (x,y) Color data is stored in frame buffers Primitive operations

setpixel (x,y,color) Sets the pixel at position (x,y) to the given color

getpixel(x,y) Gets the color at position (x,y)

Page 7: INT 840E Computer graphics Introduction & Graphic’s Architecture.

Basic line Drawing

Set the color of the pixel to approximate the appearance of a line from (x0,y0) to (x1,y1)

Lines are the basic unit of drawing polygons

Color set before rendering

Page 8: INT 840E Computer graphics Introduction & Graphic’s Architecture.

2D-Graphics

Screen coordinate system Pixels Regular Cartesian grid Origin (0,0)

World coordinate system Scene space Application specific, flexibility(Zoom) Represents real world distance and space

Viewpoint Rectangular region of the screen used to

display drawing

Page 9: INT 840E Computer graphics Introduction & Graphic’s Architecture.

Elements of a Picture There are four common elements of a picture:

polylines, filled regions, text, raster images.

Polylines A polyline is a finite sequence of line segments

(edges) joined end to end to vertices. A single line segment is a special case. A polyline is closed if it ends where it starts. A polyline is simple if it does not self-intersect. A simple, closed polyline is also called a simple

polygon.

Page 10: INT 840E Computer graphics Introduction & Graphic’s Architecture.

Polyline cont’d

A polyline in the plane is a sequence of the (x; y) coordinates of its vertices.

Polyline representation1. Graphical attributes (color, line width

2. Line style (solid, dotted, dashed),

3. How consecutive segments are joined (rounded, mitered or beveled.

 Many graphics systems support common special cases of curves e.g circles, ellipses, circular and arcs.

Page 11: INT 840E Computer graphics Introduction & Graphic’s Architecture.

Filled regions Filled polylines with a color or repeating pattern. A polyline with embedded “holes” also naturally

defines a region that can be filled. Even if a polyline is not simple, it is possible to

generalize the notion of interior

Page 12: INT 840E Computer graphics Introduction & Graphic’s Architecture.

Texts Text can be thought of as a sequence of

characters in some font. Attributes of a text includes:

The font’s face (Times-Roman, Courier) The weight (normal, bold, light) The style or slant (normal, italic, oblique) The size, measured in points The color.

Example

Face: Times New Roman Style: Slanted

Weight :Bold Size : 10 points

Page 13: INT 840E Computer graphics Introduction & Graphic’s Architecture.

Raster Images

Any computer generated 2-dimensional array of square cells called pixels.

Also called pixel maps. Image made up of black and white pixels is

called a bitmap. For gray-scale (or monochrome) raster

images , each pixel is represented by assigning it a numerical value from 0 to 255, ranging from black to white). 

Page 14: INT 840E Computer graphics Introduction & Graphic’s Architecture.

Graphics Devices Raster Display: The display consists of a

two-dimensional array of pixels. There are two types of raster displays.

1. Video displays: Screen with a phosphor coating, that allows each pixel to be illuminated momentarily when struck by an electron beam.

2. Liquid crystal displays (LCD’s): use an electronic field to alter polarization of crystalline molecules in each pixel.

Page 15: INT 840E Computer graphics Introduction & Graphic’s Architecture.

Image Generation The computer program stores the image in a

two-dimensional array in RAM of pixel values called a frame buffer.

The display hardware produces the image line-by-line (called raster lines).

A hardware device called a video controller constantly reads the frame buffer and produces the image on the display.

A program modifies the display by writing into the frame buffer, and thus instantly altering the image that is displayed.

Page 16: INT 840E Computer graphics Introduction & Graphic’s Architecture.

Display Processor

Display processor (graphics card) is used to accelerate graphics display by maintaining the frame buffer.

A display processor does the following: Transformation: Rotations and scalings

used for moving objects and the viewer’s location.

Clipping: Removing elements that lie outside the viewing window.

Page 17: INT 840E Computer graphics Introduction & Graphic’s Architecture.

Projection: Applying the appropriate perspective transformations.

Shading and Coloring: The color of a pixel may be altered by increasing its brightness.

Texturing: Coloring objects by “painting” textures onto their surface.

Hidden-surface elimination: Determines which of the various objects that project to the same pixel is closest to the viewer and hence is displayed.

Page 18: INT 840E Computer graphics Introduction & Graphic’s Architecture.

Color In Graphics Color: The method chosen for representing color

depends on the characteristics of the graphics output device (e.g., additive as are video displays or subtractive as are printers). It also depends on the number of bits per pixel that are provided, called the pixel depth. e.g a 24-bit RGB.

Each pixel is represented as a mixture of red, green and blue components, and each of these three colors is represented as a 8-bit quantity (0 for black and 255 for the brightest color).

In many graphics systems it is common to add a fourth component, sometimes called alpha to represent the transparency.

Page 19: INT 840E Computer graphics Introduction & Graphic’s Architecture.

Color map or color look-up-table (LUT) is used to achieve smaller pixel color buffer . Each pixel is represented by an 8-bit quantity in the range from 0 to 255.

This number is an index to a 256-element array, each of whose entries is a 234-bit RGB value. To represent the image, we store both the LUT and the image itself.

The 256 different colors are usually chosen so as to produce the best possible reproduction of the image.

Digital halftoning. Colors are approximated by putting combinations of similar colors in the same area. The human eye averages them out.

Page 20: INT 840E Computer graphics Introduction & Graphic’s Architecture.

How do we represent reality1. Meshes

2. Points

Page 21: INT 840E Computer graphics Introduction & Graphic’s Architecture.

3. Sub division of surfaces

4. Geometry