[go: up one dir, main page]

0% found this document useful (0 votes)
28 views11 pages

Lec 7

This document provides an overview of key concepts in computer graphics including: 1) Pixels are the basic units that make up a digital image, with each pixel representing color and intensity. 2) There are several major areas of computer graphics including modeling, rendering, animation, and user interaction. 3) Geometric models use polygons like triangles to represent 3D objects, with each polygon defined by vertex coordinates. Rendering projects these 3D models onto 2D images using techniques like rasterization.

Uploaded by

smnepalschool
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views11 pages

Lec 7

This document provides an overview of key concepts in computer graphics including: 1) Pixels are the basic units that make up a digital image, with each pixel representing color and intensity. 2) There are several major areas of computer graphics including modeling, rendering, animation, and user interaction. 3) Geometric models use polygons like triangles to represent 3D objects, with each polygon defined by vertex coordinates. Rendering projects these 3D models onto 2D images using techniques like rasterization.

Uploaded by

smnepalschool
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Lecture ۷ Computer Principles

University of Technology
Computer Engineering Department
Computer Principles

Asst.Lect. Zinah Jaafer Mohammed Ameen

Lecture ۷
Introduction to Computer Graphics
Lecture Layout:

• Introduction to Computer Graphics


• Pixels
• Graphics Areas
• Geometric Model
• Rendering
• Shading and Materials
• Color in Computer Graphics
• Major Applications

1
Lecture ۷ Computer Principles

 Introduction to Computer Graphics


The term computer graphics describes any use of computers to create store
and manipulate images. Computer graphics is one of the most effective and
commonly used ways to communicate the processed information to the user.
It displays the information in the form of graphics objects such as pictures,
charts, graphs and diagrams instead of simple text. Thus we can say that
computer graphics makes it possible to express data in pictorial form. The
picture or graphics object may be an engineering drawing, business graphs,
architectural structures, a single frame from an animated movie or a machine
parts illustrated for a service manual.
The computer graphics allows rotation, translation, scaling and performing
various projections on the picture before displaying it. It also allows adding
effects such as hidden surface removal, shading or transparency to the
picture before final representation. It provides user the control to modify
contents, structure, and appearance of pictures or graphics objects using
input devices such as a keyboard, mouse, or touch-sensitive panel on the
screen. There is a close relationship between the input devices and display
devices. Therefore, graphics devices includes both input devices and display
devices.

2
Lecture ۷ Computer Principles

 Pixels

A computer image is usually represented as a discrete grid of picture


elements which is called pixels. There are special procedures determine
which pixel will provide the best approximation to the desired picture or
graphics object .The process of determining the appropriate pixels for
representing picture or graphics object is known as rasterization, and the
process of representing continuous picture or graphics object as a collection
of discrete pixels is called scan conversion. The number of pixels determines
the resolution of the image. Typical resolution ranges from 320*200 to
2000*1500. For a black and white image, a number describes the intensity of
each pixel. It can be expressed between 0.0 (black) and 1.0 (white).
However, for internal binary representation reasons, it is usually stored as an
integer between 0 (black) and 255 (white).

Left: A low-resolution digital black and white image. Right: Color.

For a color image, each pixel is described by a triple of numbers


representing the intensity of red, green and blue. For example, pure red is
(255, 0, 0) and purple is (255, 0, 255). Because the image is represented by a
discrete array of pixels, aliasing problems may occur. The
term aliasing pertains to the process of sampling something smooth and

3
Lecture ۷ Computer Principles

continuous using a series of discrete measurements. The sampling that


occurs is due to rasterization. The most classical form of aliasing is the
aspect of lines. Anti aliasing techniques are thus required. In the case of the
line, it consists in using intermediate gray levels to “smooth” the appearance
of the line.

A line without and with anti aliasing

 Graphics Areas
Practitioners would agree on the following major areas of computer
graphics:
• Modeling the process of forming a computer model of an object's
shape. For example, a coffee mug might be described as a set of
ordered 3D points along with some interpolation rule to connect the
points and a reflection model that describes how light interacts with
the mug.
• Rendering is a term inherited from art and deals with the creation of
shaded images from 3D computer models.
• Animation is a technique to create an illusion of motion through
sequences of images. Animation uses modeling and rendering but
adds the key issue of movement over time, which is not usually dealt
with in basic modeling and rendering.

4
Lecture ۷ Computer Principles

There are many other areas that involve computer graphics, and whether
they are core graphics areas is a matter of opinion. Such related areas
include the following:
 User interaction deals with the interface between input devices such
as mouse and tablets, the application, feedback to the user in imagery,
and other sensory feedback.
 Virtual reality attempts to immerse the user into a 3D virtual world.
This typically requires at least stereo graphics and response to head
motion. For true virtual reality, sound and force feedback should be
provided as well.
 Image processing deals with the manipulation of 2D images and is
used in both the fields of graphics and vision.
 3D scanning uses range-finding technology to create measured 3D
models. Such models are useful for creating rich visual imagery, and
the processing of such models often requires graphics algorithms.
 Computational photography is the use of computer graphics,
computer vision, and image processing methods to enable new ways
of photographically capturing objects, scenes, and environments.
 Geometric Model
Polygons
Basically, a 3D model is formed from points called vertices (or vertexes) that
define the shape and form polygons. A polygon is an area formed from at
least three vertexes (a triangle). A four-point polygon is a quad, and a
polygon of more than four points is an n-gon. The overall integrity of the
model and its suitability to use in animation depend on the structure of the
polygons. Therefore thee most classical method for modeling 3D geometry
is the use of polygons. An object is approximated by a polygonal mesh, that
5
Lecture ۷ Computer Principles

is a set of connected polygons. Most of the time, triangles are used for
simplicity and generality.

Left: A cow modeled as a mesh of triangles. Right: This triangle can be


stored using the coordinates of its vertices as [(2,4,2), (3,1,0), (1,1,2)].
Each polygon or triangle can be described by the 3D coordinates of its list of
vertices. The obvious limitation of triangles is that they produce a flat and
geometric appearance.
 Rendering
Projection and Rasterization
The image projection of the 3D objects is computed using linear
perspective. Given the position of the viewpoint and some camera
parameters (e.g. field of view), it is very easy to compute the projection
of a 3D point onto the 2D image. Mathematically, this can be simply
expressed using a 4*4 matrix. In most methods, the geometric entities are
then rasterized. It consists in drawing all the pixels covered by the
entity. In the example below, the projections of the 3 red points have
been computed using linear perspective, and the triangle has then been
rasterized by filling the pixels in black. For richer rendering, the color of

6
Lecture ۷ Computer Principles

each rasterized pixel must take into account the optical properties of the
object.

 Shading and materials


Incresing the scene with light sources allows for better rendering. The
objects can be shaded according to their interaction with light. There are
various shading models. They describe how light is reflected by object,
depending on the relative orientation of the surface, light source and
viewpoint.

7
Lecture ۷ Computer Principles

Light reflection model

This vase has been modeled as a symmetrical pattern of vertically-oriented


surfaces - tiny flat patches which approximate the round shape of the vase.
By introducing a technique called Gouraud shading, we can smooth out the
appearance of the vase and hide the individual surfaces from view. The
shading is varied on each surface in proportion to values calculated at the
edges and from neighboring surfaces.

8
Lecture ۷ Computer Principles

 Color in Computer Graphics

9
Lecture ۷ Computer Principles

Computers typically display color in three components - red, green, and


blue. When combined, these three colors make the full-color image seen in
the upper left of this image.
 Major Applications
• Video games increasingly use sophisticated 3D models and rendering
algorithms.
• Cartoons are often rendered directly from 3D models. Many
traditional 2D cartoons use backgrounds rendered from 3D models,
which allows a continuously moving viewpoint.
• Visual effects use almost all types of computer graphics technology.
Many films also use 3D modeling and animation to create synthetic
environments, objects, and even characters that most viewers will
never suspect are not real.
• Animated films use many of the same techniques that are used for
visual effects, but without necessarily aiming for images that look
real.
• CAD/CAM stands for computer-aided design and computer-aided
manufacturing. These fields use computer technology to design parts
and products on the computer and then, using these virtual designs, to
guide the manufacturing process. For example, many mechanical parts
are designed in a 3D computer modeling package and then
automatically produced on a computer-controlled milling device.
• Simulation can be thought of as accurate video gaming. For example,
a flight simulator uses sophisticated 3D graphics to simulate the
experience of flying an airplane. Such simulations can be extremely
useful for initial training in safety-critical domains such as driving,

10
Lecture ۷ Computer Principles

and for scenario training for experienced users such as specific fire-
fighting situations that are too costly or dangerous to create
physically.
• Medical imaging creates meaningful images of scanned patient data.
Computer graphics is used to create shaded images that help doctors
extract the most salient information from such data.

11

You might also like