Lecture 6: 3D graphics Concepts 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 718,  ex 2271 

Slides:



Advertisements
Similar presentations
15.1 Si23_03 SI23 Introduction to Computer Graphics Lecture 15 – Visible Surfaces and Shadows.
Advertisements

8.1si31_2001 SI31 Advanced Computer Graphics AGR Lecture 8 Polygon Rendering.
Exploration of advanced lighting and shading techniques
Lecture 8 Transparency, Mirroring
Graphics Pipeline.
2 COEN Computer Graphics I Evening’s Goals n Discuss the fundamentals of lighting in computer graphics n Analyze OpenGL’s lighting model n Show.
Three Dimensional Viewing
David Luebke5/16/2015 Administrivia l Back on track: canceling OpenGL lecture 2 l Assignment 1 –Greg Yukl found an alternate XForms site:
CS 4363/6353 INTRODUCTION TO COMPUTER GRAPHICS. WHAT YOU’LL SEE Interactive 3D computer graphics Real-time 2D, but mostly 3D OpenGL C/C++ (if you don’t.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Object-Order vs. Screen-Order Rendering April 24, 2003.
1 3D modelling with OpenGL Brian Farrimond Robina Hetherington.
Further Programming for 3D applications CE Introduction to Further Programming for 3D application Bob Hobbs Faculty of Computing, Engineering and.
3.1si31_2001 SI31 Advanced Computer Graphics AGR Lecture 3 Viewing Transformation Getting Started with OpenGL Introduction to Projections.
Graphics Systems I-Chen Lin’s CG slides, Doug James’s CG slides Angel, Interactive Computer Graphics, Chap 1 Introduction to Graphics Pipeline.
Scenes, Cameras & Lighting. Outline  Constructing a scene  Using hierarchy  Camera models  Light models.
3D Rendering with JOGL Introduction to Java OpenGL Graphic Library By Ricardo Veguilla
Lecture 3: Transforms 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 711,  ex 2271 
Lecture 7: Objects and Interaction 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 718,  ex 2271 
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 19 Other Graphics Considerations Review.
Lecture 5: 3D Rendering Pipeline (II) Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering Georgia Institute of Technology.
COMP 261 Lecture 14 3D Graphics 2 of 2. Doing better than 3x3? Translation, scaling, rotation are different. Awkward to combine them. Use homogeneous.
University of Illinois at Chicago Electronic Visualization Laboratory (EVL) CS 426 Intro to 3D Computer Graphics © 2003, 2004, 2005 Jason Leigh Electronic.
3D coordinate systems X Y Z Right-Hand Coordinate System X Y Z Left-Hand Coordinate System OpenGL uses this! Direct3D uses this!
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
CSE 381 – Advanced Game Programming Basic 3D Graphics
Week 2 - Wednesday CS361.
Computer Graphics World, View and Projection Matrices CO2409 Computer Graphics Week 8.
Lecture 8: Texture Mapping 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 718,  ex 2271
Computer Graphics An Introduction. What’s this course all about? 06/10/2015 Lecture 1 2 We will cover… Graphics programming and algorithms Graphics data.
Computer Graphics. Requirements Prerequisites Prerequisites CS 255 : Data Structures CS 255 : Data Structures Math 253 Math 253 Experience with C Programming.
COMP 261 Lecture 16 3D Rendering. input: set of polygons viewing direction direction of light source(s) size of window. output: an image Actions rotate.
Shading & Texture. Shading Flat Shading The process of assigning colors to pixels. Smooth Shading Gouraud ShadingPhong Shading Shading.
Lecture 5: Interaction 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 711,  ex 2271 
MIT EECS 6.837, Durand and Cutler Graphics Pipeline: Projective Transformations.
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
Lecture 9: Lighting and Shading 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 718,  ex 2271
Homogeneous Form, Introduction to 3-D Graphics Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, October 20,
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
1Computer Graphics Lecture 4 - Models and Architectures John Shearer Culture Lab – space 2
COMPUTER GRAPHICS CSCI 375. What do I need to know?  Familiarity with  Trigonometry  Analytic geometry  Linear algebra  Data structures  OOP.
Lecture 11: Exam Revision 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 718,  ex 2271  Coursework.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
Programming 3D Applications CE Displaying Computer Graphics Week 3 Lecture 5 Bob Hobbs Faculty of Computing, Engineering and Technology Staffordshire.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
Control flow for interactive applications CSE 3541 Matt Boggus.
Lecture 2: Some definitions of terms 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 711,  ex 2271 
Advanced Computer Graphics Shadow Techniques CO2409 Computer Graphics Week 20.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Chapters 5 2 March Classical & Computer Viewing Same elements –objects –viewer –projectors –projection plane.
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
Local Illumination and Shading
Improving the appearance of 3D OpenGL scenes
Coordinate Systems Lecture 1 Fri, Sep 2, The Coordinate Systems The points we create are transformed through a series of coordinate systems before.
1 PTT 105/3: Engineering Graphics. TAXONOMY OF PLANAR GEOMETRIC PROJECTIONS PTT 105/3: Engineering Graphics 2 Planar Geometric Projections Parallel Multiview.
1 Computer Graphics Week11 : Hidden Surface Removal.
On to 3D Introduction to Computer Graphics and Animation (Principle of Computer Graphics) Rattapoom Waranusast.
CS 551 / 645: Introductory Computer Graphics Viewing Transforms.
Coordinate Systems Lecture 20 Wed, Oct 15, Object Coordinates Each object has its own “local” coordinate system, called object coordinates. Normally.
Digital Media Dr. Jim Rowan ITEC 2110 Vector Graphics II.
Viewing. Classical Viewing Viewing requires three basic elements - One or more objects - A viewer with a projection surface - Projectors that go from.
Introduction to Computer Graphics
Administrivia Back on track: canceling OpenGL lecture 2 Assignment 1
Modeling 101 For the moment assume that all geometry consists of points, lines and faces Line: A segment between two endpoints Face: A planar area bounded.
Unit 4 3D Viewing Pipeline Part - 2
CS451Real-time Rendering Pipeline
Computer Graphics Imaging
Dr. Jim Rowan ITEC 2110 Vector Graphics II
Game Programming Algorithms and Techniques
Computer Graphics Material Colours and Lighting
Dr. Jim Rowan ITEC 2110 Vector Graphics II
Presentation transcript:

Lecture 6: 3D graphics Concepts 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 718,  ex 2271   Web page includes: announcements, handouts, web links, reading hints, frequently asked questions

Lecture 6: 3D graphics Concepts 2 Misc Info  Misc. functions  glPostRedisplay() - forces redrawing of the screen without waiting for a window event  glPrint(x,y,string) wraps up the output() function and uses the font variable as in L:\cd2012\bitfont.cpp  Draws a string starting at x,y

Lecture 6: 3D graphics Concepts 3 Today’s Lecture: 3D concepts  Coursework 1: Any questions, ask me in the Lab  Today: 3D graphics concepts  Cues to the dept of a scene  Perspective  Hidden line and surface removal  3D shapes and surfaces  Viewpoints  Lighting  Shading  Texture and Materials  An example program, cube.cpp will demonstrate some of these (see code in L:\CD2012)

Lecture 6: 3D graphics Concepts 4 Perspective  The idea of perspective - that distant objects look proportionally smaller - was discovered by artists in the 16th Century  Perspective is used in 3D computer graphics to give an impression of depth and of distance from the viewer

Lecture 6: 3D graphics Concepts 5 Perspective in OpenGL  In OpenGL we can specify  Perspective viewing or  Orthographic viewing  The later is useful for architectural models with no reduction in size with depth glMatrixMode(GL_PROJECTION); gluPerspective( /* field of view in degree */ 40.0, /* aspect ratio */ 1.0, /* Z near */ 1.0, /* Z far */ 10.0); glMatrixMode(GL_MODELVIEW);

Lecture 6: 3D graphics Concepts 6 Hidden Line/Surface Removal  In 2D graphics we can pretend another object is in front of another simply by drawing them in the right order  In 3D graphics we need to determine which pixels of a line or surface might be behind another - the pixels are sorted along the Z axis (Z buffering).  glEnable(GL_DEPTH_TEST) will hide hidden pixels

Lecture 6: 3D graphics Concepts 7 Lighting  The human vision system also uses the way light reflects off objects to work out their position and orientation  In 3D computer graphics we can set up different kinds of lighting and model the way the light is reflected off the surfaces of objects  In OpenGL and other 3D libraries we can create different kinds of lights and set their properties  Types: Ambient, Diffuse, Spotlight  Properties: Position, orientation, intensity, colour  Properties can be changed in real-time to give animation and other special effects  How is this lecture room illuminated?

Lecture 6: 3D graphics Concepts 8 Shading  Objects can be shaded by calculating the surface normal and then calculating the amount of light that is reflected.  Pixel colours are recalculated.  We can also specify flat shading or smooth shading

Lecture 6: 3D graphics Concepts 9 Shading ….  In the example program you can rotate the object to see the shading change  The program uses the keys() function to rotate the object around the x, y and Z axes  Looking at the code can you tell how each keyboard input rotates the object?

Lecture 6: 3D graphics Concepts 10 Viewpoints  Once we have lit an object and specified the perspective we can then position the viewpoint of the camera or human viewer  Viewpoints are specified by  The x,y,z position of the eye  Where the centre of the world is  The orientation of the eye  For example gluLookAt(0.0, 0.0, 5.0, /* eye is at (0,0,5) */ 0.0, 0.0, 0.0, /* center is at (0,0,0) */ 0.0, 1.0, 0.); /* up is in positive Y direction */

Lecture 6: 3D graphics Concepts 11 Viewpoints ….  We can specify multiple viewpoints and swap between them to get different views of the scene  Or we could animate the viewpoint to give the impression that the user is moving  We could  Animate along X and Z to give a walking motion  Animate along X, Y and Z to give a flying motion  Animate around an axis to rotate the world  Animate around an object to rotate the object

Lecture 6: 3D graphics Concepts 12 3D shapes and surfaces  We have seen how 2D shapes can be drawn by specifying the vertices or corners of the shape  We then say how the corners are joined and the shape filled in with the argument to glBegin()  For 3D shapes we specify each vertex as a point in 3D space using the x, y and z values  Additionally GLUT has functions for drawing  Cube, Torus, Sphere, Cone, Teapot and other 3D objects

Lecture 6: 3D graphics Concepts 13 Cube.cpp example  The example program listed in cube.cpp (L:\cd2012\cube.cpp) draws a red 3D cube rotated slightly. It is lit by a diffuse light located in the top right of the scene  The cube is drawn by calls to glVertex3fv() which takes an array of points to define each face of the cube  The perspective is then set up  The eye is then positioned  The objected is then translated and rotated to give a better view  Finally keys() has been added to show the effect of rotation under a light.

Lecture 6: 3D graphics Concepts 14 Next Week  Reading week:  No lecture or lab next week  Continue with the coursework  Future weeks  More on interaction  Look more at the concepts of 3D graphics