Upload
nguyendieu
View
257
Download
7
Embed Size (px)
Citation preview
COMPUTER GRAPHICS
(13MCA34)
1. GENERAL INFORMATION
Academic Year: 2015 Semester(s):I I I
Title Code Duration
(hrs) COMPUTER GRAPHICS
13MCA34 Lectures
52 Hrs
Total: 52 Hrs
2. FACULTY DETAILS
Details
Name SABEEHA SULTANA Department MCA Room Number 514 Phone No. 9880973306 E-mail address [email protected] Contact Hours Office Hours Consultation Time By Email
3. VENUE AND HOURS/WEEK All lectures will normally be held in 603. Lecture Hours/week: 4Hr
PESIT- Bangalore South Campus
Hosur Road (1km Before Electronic city)
Bangalore – 560 100
Department of MCA COURSE INFORMATION SHEET
4. COURSE OBJECTIVE
Know and be able to describe the general software architecture of programs that use 3D computer
graphics.
Know and be able to discuss hardware system architecture for computer graphics. This includes, but is
not limited to: graphics pipeline, frame buffers, and graphic accelerators/co-processors.
Know and be able to use a current 3D graphics API (e.g., OpenGL or DirectX).
Know and be able to use the underlying algorithms, mathematical concepts, supporting computer
graphics. These include but are not limited to:
Composite 3D homogeneous matrices for translation, rotation, and scaling transformations.
Plane, surface normals, cross and dot products.
Hidden surface detection / removal.
Scene graphs, display lists.
Know and be able to select among models for lighting/shading: Color, ambient light; distant and light
with sources; Phong reflection model; and shading (flat, smooth, Gourand, Phong).
Know and be able to use and select among current models for surfaces (e.g., geometric; polygonal;
hierarchical; mesh; curves, splines, and NURBS; particle.
Know and be able to design and implement model and viewing transformations, the graphics pipeline
and an interactive render loop with a 3D graphics API.
Be able to design and implement models of surfaces, lights, sounds, and textures (with texture
transformations) using a 3D graphics API.
Be able to discuss the application of computer graphics concepts in the development of computer games,
information visualization, and business applications.
Be able to discuss future trends in computer graphics and quickly learn future computer graphics
concepts and APIs.
5. COURSE OUTCOMES
Upon completion of the subject, students will be able to:
Professional/academic knowledge and skills
Pain proficiency in 3D computer graphics API programming;
Understand the interactive computer graphics architecture;
possess in-depth knowledge of display systems, image synthesis, shape
modeling, and interactive control of 3D computer graphics applications;
Enhance their perspective of modern computer system with modeling,
Analysis and interpretation of 2D and 3D visual information.
Understand, appreciate and follow the development and advancement of
computer graphics technologies, including advanced technologies for 3D
Modelling, high performance rendering
6. MODULE SPECIFICATION: Class
No
Topic Topic Description % of
syllabus
covered
in the
topic
Cumulative %
of Syllabus
1
Graphics Output
Primitives and Attributes
Introduction to open
GL,Coordinate reference
frames,
15
15 2 Specifying two dimensional
world coordinate reference
frame in Open GL, Open GL
point functions, 3 Open GL line functions, 4 Line drawing algorithms 5 Circle generation algorithms 6 Ellipse generation algorithms, 7 Fill area primitives, Polygon
fill areas 8 OpenGL polygon fill area
functions
9 General scan line polygon fill
algorithm
10 Fill methods for areas with
irregular boundaries
11
Open GL fill area attribute
functions
12
Two – Dimensional and
Three - Dimensional
Geometric
Transformations
Basic two dimensional
geometric transformations
20
40
13 Matrix representations and
homogeneous coordinates, , 14 Inverse transformations
15 Two dimensional composite
transformations 16 Other two dimensional
transformations 17 Three dimensional Translation,
Rotation, Scaling 18 Other three dimensional
transformations, 19 Affine transformations, 20 Open GL geometric
transformation functions 21
22
Two Dimensional
Viewing
The two dimensional viewing,
20
60 23 Clipping window,
Normalization 24 Viewport transformations
25 Clipping algorithms, 26 Two dimensional point
clipping 27 Two dimensional line clipping
algorithms 28 Two dimensional line clipping
algorithms 29 Polygon fill area clipping 30 Polygon fill area clipping 31 Polygon fill area clipping, 32 Curve clipping, Text clipping
33
Three Dimensional
Viewing
The three dimensional viewing
concepts
20
80 34 Three dimensional viewing
pipeline
35 Three dimensional viewing
coordinate parameters
36 Transformation from world to
viewing coordinates, 37 Projection transformations,
Orthogonal projections, 38 Oblique parallel
Projections
39 Perspective projections
40 The viewport transformation
and three dimensional
41 screen coordinates
42
Curves and Computer
Animation
Raster methods for computer
animation
20
100
43 Raster methods for computer
animation 44 Raster methods for computer
animation
45 Traditional animation
techniques
46 General computer animation
functions
47 48 Bezier spline curves
7. RECOMMENDED BOOKS
A. PRESCRIBED TEXTBOOK
Donald Hearn, M.Pauline Baker, Computer Graphics with Open GL, Pearson (Indian
Edition), Third Edition. Chapters and topics [2.9, 3.1-3.5, 3.9, 3.10, 3.14-3.16, 4.10, 4.13,
4.14, 5.1-5.5, 5.10-5.15, 5.17, 6.1-6.3, 6.5-6.10, 7.1-7.9, 8.10, 13.1-13.4]
B. REFERENCE BOOKS 1. Edward Angel, ‘Interactive Computer Graphics’ – A top down approach using Open
GL, Pearson, Fifth Edition
2. Peter Shirley, Steve Marschner, 'Computer Graphics, Cengage Learning (Indian edition),
2009.
8. ASSIGNMENT(S)
Assignment
Programs on Animations
9.ASSESSMENT
A. WRITTEN EXAMINATION
Paper Structure
No. Of Questions 8 Main Questions No. of questions to be answered 5
Exams date Nov/Nov2014
(Tentative) Paper Duration 3 Hrs
Total Marks 100 Pass Marks 40
B. CONTINUOUS ASSESSMENT
Weighting (%)
Assignment(s): 5 Marks (10%)
Seminar(s): 5 Marks (10%)
Class Test(s) 5 Marks (10%)
Class Interaction 5 Marks(10%)
Test(s): 30 Marks (60%)
Total Marks: 50 arks
10. QUESTION BANK
Computer Graphics (COMP136) Quiz 3
This is a standard multiple choice test. Each question has only one correct answer.
Please mark that one answer clearly on the answer sheet provided. If any question has more than one answer filled in, it will be marked wrong. There are XX questions. You
will have XX minutes.
1) Which of the following is NOT true about quaternions?
a) They are made up of 4 numbers b) They should always be normalized to length 1
c) They can be used to represent all affine transforms d) They can be used to define the rotation of an object
2) Which of the following does NOT figure into the Field of View of a pinhole camera? a) The direction of projection
b) The distance from the center of projection to the projection plane c) The size of the projection plane
3) This projection technique has the direction of projection perpendicular to the viewing plane, but the viewing direction is NOT perpendicular to one of the
principle faces. a) Orthographic Parallel Projection
b) Axonometric Parallel Projection c) Oblique Parallel Projection
4) This projection technique does NOT have the direction of projection perpendicular
to the viewing plane. a) Orthographic Parallel Projection
b) Axonometric Parallel Projection c) Oblique Parallel Projection
5) This projection technique has the direction of projection perpendicular to the viewing plane, and the viewing direction is perpendicular to one of the principle
faces. a) Orthographic Parallel Projection
b) Axonometric Parallel Projection c) Oblique Parallel Projection
6) When transforming a random Axis-Aligned Bounding Box defined by the points
(nearx, neary, nearz) and (farx, fary, farz) to the standard orthographic viewing box, which affine transforms are used?
a) shear and translation b) rotation and scale
c) scale and shear d) translation and scale
7) In class, we discussed the purpose of the front and back clipping planes in OpenGL. Which of the following was NOT a purpose for using clipping planes?
a) division by zero b) objects behind the center of projection mapping onto the projection plane
c) avoiding the problems of infinite viewing volume size
8) In class, we discussed how the image of the Double Eagle Tanker was obtained for
the large poster in the main hall of Sitterson. It required rendering several perspective images using OpenGL. Which of the following was NOT a step required
in that process? a) handling projection planes non-orthogonal to the viewing direction
b) cutting a single projection plane into many separate projection planes c) rotating the viewing direction to be the same as the –z direction
d) handling several different centers of projection 9) In OpenGL, there are several different matrices. We have discussed two of them in
class. Which one of the below would be used in conjunction with a glRotatef function call?
a) GL_MODELVIEW b) GL_PROJECTION
10) In OpenGL, there are several different matrices. We have discussed two of them in
class. Which one of the below would be used in conjunction with glFrustum? a) GL_MODELVIEW
b) GL_PROJECTION 11) Which of the following is the order that geometry operations are performed in
OpenGL (where we read the order from left to right)? a) GL_PROJECTION GL_MODELVIEW Perspective division
b) GL_MODELVIEW GL_PROJECTION Perspective division c) Perspective division GL_PROJECTION GL_MODELVIEW
d) GL_MODELVIEW Perspective division GL_PROJECTION
e) GL_PROJECTION Perspective division GL_MODELVIEW For the next 4 questions, match the pictures on the right with the corresponding term on
the left. The arrows in the picture denote light rays. The dashed lines represent the material type to be considered. The key is in the interaction of the light rays with the
material. 12) Specular
13) Diffuse
14) Transparent 15) Translucent
answers: b,d,c,a
(a)
(b)
(c)
(d)
16) In “Utah” graphics, lights are simplified in order to approximate light/matter interaction with a minimum amount of work. Which of the following is NOT true
about the simplifications made in “Utah” graphics lights? a) Light intensity and color are folded into one value.
b) Lights are assumed to have zero size
c) Spotlights can not be handled d) Soft shadows can not be handled
17) The Phong reflection model simplifies light-matter interactions into (essentially) 4 vectors and a number of constants. Each piece of the Phong model uses different
vectors and constants. Which portion does NOT include taking a dot product? a) Ambient
b) Diffuse c) Specular
18) The Phong reflection model simplifies light-matter interactions into (essentially) 4 vectors and a number of constants. Which piece of the Phong model is responsible
for giving spheres their bright white spots? a) Ambient
b) Diffuse c) Specular
19) The Phong reflection model simplifies light-matter interactions into (essentially) 4
vectors and a number of constants. Which of the following is NOT a vector needed for the Phong reflection model?
a) Surface Normal b) Direction to Viewer
c) Direction to Material Center d) Direction to Light
20) True or false: In the Phong Reflection model, ambient light is the same everywhere.
a) true b) false
21) In the Phong reflection model, there are 3 constants (a, b, c) which are used to describe the qualities of which of the following phenomena?
a) The material reaction to ambient, diffuse and specular light (respectively) b) The amount to perturb reflection vectors as they are mirrored across the
normal
c) The size (in each dimension) which the light is assumed to have d) The attenuation of a point light source with distance
22) As discussed in class, when obtaining normals for a triangle, which of the following mathematical constructs is NOT used?
a) Point-Point subtraction b) Vector dot products
c) Vector cross products d) Vector normalization
As promised after the second quiz was handed back: Questions 23-31: Please fill in the following matrix. This is to be the general rotation matrix for rotation around the
x-axis.
[ (23) (24) (25) 0 ] [ (26) (27) (28) 0 ]
[ (29) (30) (31) 0 ] [ 0 0 0 1 ]
a) sin(Θ)
b) –sin(Θ)
c) cos(Θ) d) 1
e) 0
23) d 24) e
25) e 26) e
27) c 28) b
29) e 30) a
31) c
Q1. What do you mean by computer graphics? Ans. The branch of science and technology concerned with methods and techniques for converting data
to or from visual presentation using computers.
Q2.What are the applications of computer graphics? Ans. 1. Computer Aided Design
2. Graphical User Interface
3. Entertainment
4. Simulation and Training
5. Education and Presentation
6. Computer Generated Art
7. Scientific Visualization
8. Image Processing
9. Virtual reality
10. Cartography
Q3.What do you mean by interactive computer Graphics? Ans. Interactive computer Graphics like a website, it is only useful if it is browsed by a visitor and no
two visitors are exactly alike. It means the website must support the interaction of users with a variety
of skills, interests and end goals. Interactive computer graphics involves the user’s interaction.
Q4. What do you mean by GUI? Ans. GUI stands for Graphical user interface. A major component of a GUI is a window manager that
allows a user to display multiple-window areas. To make a particular window active we simply click
in that window using an interactive pointing device. Interfaces also display menus and icons for fast
selection of processing options or parameter values.
Q5. What does it mean by RGB? Ans. The RGB is a color model, it is an additive color model in which red, green, and blue light are
added together in various ways to reproduce a broad array of colors. The name of the model comes from
the initials of the three additive primary colors, red, green, and blue. The main purpose of the RGB
color model is for the sensing, representation, and display of images in electronic systems, such as
televisions and computers, though it has also been used in conventional photography.
Q6. Define VDU? Ans. A monitor or display (sometimes called a visual display unit) is a piece of electrical equipment
which displays images generated by devices such as computers, without producing a permanent
record. The monitor comprises the display device, circuitry, and an enclosure. The display device in
modern monitors is typically a thin film transistor liquid crystal display (TFT-LCD), while
older monitors use a cathode ray tube (CRT).
Q7. Define persistence in terms of CRT Phosphorous. Persistence is the one of the major property of phosphorous used in CRT’s. It means how long they
continue to emit light after the electron beam is removed.
Q8. Define resolution.
The maximum number of points that can be displayed without overlap on a CRT is referred to as the
resolution.
Q8. What do you mean by an aspect ratio? Aspect ratio is a number which gives the ratio of vertical points to horizontal points necessary to
produce equal length lines in both directions on the screen. An aspect ratio of ¾ means that a
vertical line plotted with three points has same length as a horizontal line plotted with 4 points.
Q9.What are the different properties of phosphorus? 1. Color
2. Persistence
Q10. Differentiate raster and random scan displays. Ans. In a raster scan displays the electron beam is swept across the screen, one row at a time from top to
bottom. Contrasting in random scan displays the electron beam is directed to the parts of the screen
where a picture is to be drawn.
Q11.Define refresh buffer/Frame buffer? Picture definition is stored in a memory area called the refresh buffer or frame buffer. This memory
area holds the set of intensity values for all the screen points.
Q13. Define bitmap. Ans. On a black and white system with one bit per pixel, the frame buffer is commonly known as a
bitmap.
Q14. What do you mean by retracing? Define horizontal as well as vertical retracing. Ans. At the end of each scan line, the electron beam returns to the left side of the screen to begin
displaying the next scan line. The return to the left of the screen, after refreshing each scan line is called
the horizontal retrace. And at the end of each frame, the electron beam returns to the top left corner of
the screen to begin the next frame is called the vertical retrace.
Q15.What do you mean by interlacing? Ans. It is the method of incrementally displaying a visual on a CRT. On some raster scan systems, each
frame is displayed in two passes using an interlaced refresh procedure. In the first pass, the beam seeps
across every other scan line from top to bottom. Then after the vertical retrace, the beam sweeps out the
remaining scan lines.
Q16. What is a Beam penetration method? Ans. This technique is used in random scan display systems. Two layers of phosphor (red and green)
are coated onto the inside of the CRT screen, the displayed colors depends on how far the electron beam
penetrates into the phosphors layers. A slow electron beam excites only the outer red layer. A very fast
electron beam penetrates trough the red layer and hence excites the green layer. An average electron
beam gives the combination of red and green color. That is yellow and orange. This technique only
provides four colors.
Q17. Define shadow masking. This technique is used in raster scan display devices. It gives much wider range of colors than a beam
penetration method. A shadow Mask CRT has three phosphor color dots at each pixel location. One
phosphor dot emits a red light, another emits green light and the last one emits a blue light. This type of
CRT also has three electron guns one for each color dot. A shadow mask grid is installed just behind the
phosphor coated screen. The three electron beams are deflected and focused as a group onto the shadow
mask, which contains a series of very fine holes aligned with the phosphor dot patterns. When the three
beams pass through a hole in the shadow mask, they activate a dot triangle, which appears as a small
color spot on the screen .Different colors can be obtained by varying the intensity levels. More than 17
Q18. Translate the square ABCD whose co-ordinate are A(0,0), b(3,0), C(3,3), D(0,3) by 2 units in both direction and then scale it by 1.5 units in x direction and 0.5 units in y direction. Q44. Perform a 45o rotation of a triangle A(0,0, B(1,1), C(5,2) 1) About the origin. 2) About the point p(-1,-1) Q19. Find the transformation matrix that transforms the square ABCD whose center is at (2,2) is reduced to half of its size, with center still remaining at (2,2). The coordinate of square ABCD are A(0,0), B(0,4), C(4,4) and D(4,0). Find the co-ordinate of new square. Ans. (HINT:- After scaling the square to half of its size, the new translated square will have center at (1,1) so, translate again the new square by (1,1), so that center again reach to (2,2).) 2 6
3 1
2 4 4
2 2 4 0 3 4 1
Q20. Consider the square A(1,0), B(0,0), C(0,1), D(1,1). Rotate the square ABCD by 45o
clockwise about A(1,0). Ans . HINT:- 1) First, translate the square by Tx= -1 and Ty=0. 2) Then rotate the square by 45o.
3) Again translate the square by Tx=1 and Ty=0. Q.47. Magnify the triangle with vertices A(0,0), B(1,1) and C(5,2) to twice its size while keeping C(5,2) fixed. Ans . HINT:- 1) First, translate the triangle by Tx= -5 and Ty=-2 2) Then Magnify the triangle by twice its size 3) Again translate the triangle by Tx= 5 and Ty= 2. Q48. Prove that 2D rotate
21. Define Affine transformation? A coordinate transformation of the form
X= axxx + axyy + bx , y ’ ayxx + ayy y +by
is called a two-dimensional affine transformation. Each of the transformed
coordinates x ‘ and y ‘ is a linear function of the original coordinates x and y , and
parameters aij and bk are constants determined by the transformation type.
22. Distinguish between bitBlt and pixBlt?
Raster functions that manipulate rectangular pixel arrays are generally referred to
as raster ops. Moving a block of pixels from one location to another is also called a block
transfer of pixel values. On a bilevel system, this operation is called a bitBlt (bit-block
transfer), on multilevel system t is called pixBlt.
16. List out the various Text clipping? _ All-or-none string clipping - if all of the string is inside a clip window, keep it
otherwise discards.
_ All-or-none character clipping – discard only those characters that are not
completely inside the window. Any character that either overlaps or is outside a
window boundary is clipped.
_ Individual characters – if an individual character overlaps a clip window
boundary, clip off the parts of the character that are