sem023 cd3018 advanced computer graphics l.
Skip this Video
Loading SlideShow in 5 Seconds..
SEM023/CD3018 Advanced Computer Graphics PowerPoint Presentation
Download Presentation
SEM023/CD3018 Advanced Computer Graphics

Loading in 2 Seconds...

play fullscreen
1 / 26

SEM023/CD3018 Advanced Computer Graphics - PowerPoint PPT Presentation

  • Uploaded on

SEM023/CD3018 Advanced Computer Graphics Lecture 1 Friday Lecture 12:00 – 1300, Room 3.01 Lab/Tutorials 13:00 – 15:00, Lab 6.16/6.20 Lecturer : Dr Paul Strickland Room 737, Module Aims To explain the principles and techniques underlying 3D computer graphics.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

SEM023/CD3018 Advanced Computer Graphics

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
sem023 cd3018 advanced computer graphics

SEM023/CD3018 Advanced Computer Graphics

Lecture 1


Lecture 12:00 – 1300, Room 3.01

Lab/Tutorials 13:00 – 15:00, Lab 6.16/6.20

Lecturer: Dr Paul Strickland

Room 737,

CMPSEM023/CMPCD3018: Module Introduction

module aims
Module Aims
  • To explain the principles and techniques underlying 3D computer graphics.
  • To introduce a current 3D graphics API.
  • To develop programming skills in 3D computer graphics.
  • To introduce advanced techniques for 3D rendering and modelling.
  • To demonstrate current advanced techniques and research in computer graphics. (MSc)
learning outcomes
Learning Outcomes
  • Demonstrate competence in a current 3D graphics API.
  • Solve problems in 3D graphics and develop graphical applications.
  • Explain the principles of 3D graphics rendering and modelling.
  • Critically Evaluate algorithms for 3D graphics problems (MSc)
  • Exam: Coursework ratio: 60:40
  • Coursework worth 40%
    • Near End semester submission
  • Exam covers outcomes 2, 3 and 4
  • Coursework outcomes 1, 2, 3 and 4
outline syllabus
Outline Syllabus
  • Introduction to 3D Modelling and Rendering.
  • Basic Algorithms from 2D graphics
  • 3D Input devices
  • Principles of Geometrical Transformations (Matrix Algebra)
  • Viewing in 3D
outline syllabus6
Outline Syllabus …
  • Visual Realism
  • Visible and Hidden Surfaces
  • Illumination and Shading
  • Advanced Modelling Techniques
  • 3D animation*
  • Colour Models*
  • *Depending on time available
recommended prior study
Recommended Prior Study
  • CD1003/CD1004 or equivalent C/C++ programming knowledge
  • Basic Computer Graphics Programming
    • Which means ….
basic computer graphics
Basic Computer Graphics
  • Introduction to 2D graphics - Raster-based output, graphics primitives and 2D graphics libraries.
  • 2D programming using OpenGL
  • Handling event-driven user input in OpenGL
  • Introduction to programming 3D graphics - Primitives, transformation, translation and rotation, materials and simple lighting models
course materials
Course materials
  • Angel E, (2003) “Interactive Computer Graphics: A top-down approach with OpenGL”, Addison-Wesley, ISBN 0321190440
  • Woo Mason, Neider Jackie, David Tom, Shriner Dave. (1999) 'OpenGL 1.2 Programming Guide' 3rd Addison Wesley ISBN 0201604582 (online)
  • Lengyel, (2002) “Mathematics for 3D game programming and Computer Graphics”, Charles River Media, ISBN 1584502770
  • Foley, et al. “Computer Graphics Principles and Practice”, Addison-Wesley, ISBN 0201121107
course materials10
Course materials …
  • Will be on Blackboard
  • See also CD2012 OpenGL links from
    • (Dr. Dave England web site)
  • And L:\CD2012 especially for old examples and GLUT resources
  • GLUT works with Visual C++ and Borland.
revision and examples
Revision and Examples
  • Most of Computer Graphics involves finding the most correct and efficient algorithms to represent the real, continuous 3D world on a 2D space in discrete, pixel coordinates
  • This is achieved by mathematically and physically modelling aspects of the real world
scan conversion
Scan conversion
  • Scan conversion is the process of translating a geometric or mathematical representation of an object into a set of discrete points on the screen
  • Ideally we would like efficient algorithms which avoid too great a reliance on floating point operations
example 1 lines
Example 1: Lines
  • Geometric lines are represented by the equation y = mx +c
  • Where all values are floating point
  • And m is the slope of the line
  • Also the mathematical line has no endpoints
  • How do we draw a continuous, line in pixels?
drawing straight lines







Drawing Straight Lines
  • If the equation of the line is y = mx + c, then the slope, m, is given bym = (y2 - y1) / (x2 - x1)
  • y = m x
the basic incremental algorithm
The basic incremental algorithm
  • We can simply use rounding to Write the pixel with the least deviation from our desired mathematical line.
  • x = 1 and yi = mxi+ c and the point is:
    • (xi, round (yi))
  • However
    • This requires floating point arithmetic
    • The rounding errors grow with longer lines
bressenham s algorithm17
Bressenham’s algorithm
  • Bressenham’s algorithm
    • uses integer calculations and
    • Incrementally works out the shift in pixel values from the true line
  • This technique can also be applied to Circles
  • It uses a decision variable to decide to draw the pixel above or below the true line
bressenham s algorithm18
Bressenham’s algorithm
  • The decision variable, d is initialised
  • If d < 0, increment x, and set the decision variable to draw below the line
  • Else , increment x and y, set the decision variable to draw below the line
  • Draw Pixel at X,Y
bressenham s algorithm19
Bressenham’s algorithm

dx = x2 – x1;

dy = y2-y1;

X = x1; Y = y1; set_pixel (X,Y);

d = 2 *dy – dx;

incrE = 2 *dy;

incNE = 2*(dy –dx);

while (x < x1)


if (d<=0)

{d += incrE;X++;}


{d += incrNE; X++; Y++}

set_pixel (X,Y);


example 2 circles
Example 2: Circles
  • We can apply the same technique to circle drawing
  • The true circle can be calculated as
    • Y= +/- (R2 – X2)
  • Again this requires floating point calculations and will not produce a realistic curve
bressenham s circles




Bressenham’s Circles
  • At each point we have to decide which of the candidate pixels is closest to the true line
bressenham s circles22
Bressenham’s Circles
  • With Bressenham’s algorithm for circles we again initialise the decision variable d
  • Then for each step in x
    • If d < 0 select the top most pixel
    • Else select the lowest pixel and decrement y
  • Increment x
  • Draw Pixel at X,Y
  • See Foley and van Dam, Fig. 3.15
bressenham s circles23
Bressenham’s Circles
  • We can further refine the technique to
    • Remove floating point arithmetic (See Foley and van Dam, Fig.3.16)
    • Use 2nd order differences, i.e. the rate of change of the slope of the curve at any point
    • Only addition and subtraction is used in the decision making process (See Foley and van Dam, Fig. 3.18)
  • To compile an OpenGL program with Visual C++, see tutorial 1 in L:SEM023
  • Study the program complete.cpp. Work out the following
    • How are the coordinates of the objects specified?
    • How are the objects located in 3D?
    • How are object materials specified?

4. How is scene lighting controlled?

5. How is keyboard input handled and

6. How does the scene respond to keyboard input?

7. How are textures applied to some of the objects and not others?

8. How is graphical state managed so that objects, materials and textures are used at the right time? (hint: what do push and pop matrix do?)

3. Compile the program complete.cpp

  • We have introduced the module and the topics in 3D graphics
  • For next week: study the complete.cpp code and come up with a list of answers and further questions about the program
  • Next Week: Answering the questions about complete.cpp