Basic graphics. ReviewReview Viewing Process, Window and viewport, World, normalized and device coordinates Input and output primitives and their attributes.

Slides:



Advertisements
Similar presentations
Computer Graphics Lecture 4 Geometry & Transformations.
Advertisements

Graphics Pipeline.
Three Dimensional Viewing
In the name of God Computer Graphics Bastanfard.
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
1 Computer Graphics Week6 –Basic Transformations- Translation & Scaling.
Transformations II Week 2, Wed Jan 17
CMPE 466 COMPUTER GRAPHICS
CS5500 Computer Graphics March 22, Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Coordinate-Free Geometry When we learned simple.
IAT 3551 Computer Graphics Overview Color Displays Drawing Pipeline.
Transformations. 2 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Coordinate-Free Geometry When we learned simple geometry, most of us.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Models and Architectures Ed Angel Professor of Computer Science, Electrical and Computer.
CHAPTER 7 Viewing and Transformations © 2008 Cengage Learning EMEA.
3D Graphics Goal: To produce 2D images of a mathematically described 3D environment Issues: –Describing the environment: Modeling (mostly later) –Computing.
Geometric Objects and Transformations Geometric Entities Representation vs. Reference System Geometric ADT (Abstract Data Types)
COS 397 Computer Graphics Svetla Boytcheva AUBG, Spring 2013.
CS 480/680 Computer Graphics Representation Dr. Frederick C Harris, Jr. Fall 2012.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Geometric Transformation. So far…. We have been discussing the basic elements of geometric programming. We have discussed points, vectors and their operations.
Transformations Dr. Amy Zhang.
Programmable Pipelines. 2 Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
Week 2 - Wednesday CS361.
Two Dimensional Viewing
Intro to 3D Models Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Geometric Transformations
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1Computer Graphics Lecture 4 - Models and Architectures John Shearer Culture Lab – space 2
CAP4730: Computational Structures in Computer Graphics 3D Transformations.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Jinxiang Chai Composite Transformations and Forward Kinematics 0.
Geometric Objects and Transformation
10/3/02 (c) 2002 University of Wisconsin, CS 559 Last Time 2D Coordinate systems and transformations.
16/5/ :47 UML Computer Graphics Conceptual Model Application Model Application Program Graphics System Output Devices Input Devices API Function.
Computer Graphics Chapter 6 Andreas Savva. 2 Interactive Graphics Graphics provides one of the most natural means of communicating with a computer. Interactive.
C O M P U T E R G R A P H I C S Guoying Zhao 1 / 52 C O M P U T E R G R A P H I C S Guoying Zhao 1 / 52 Computer Graphics Three-Dimensional Graphics I.
OpenGL The Viewing Pipeline: Definition: a series of operations that are applied to the OpenGL matrices, in order to create a 2D representation from 3D.
Computer Graphics 3D Transformations. Translation.
Geometric Transformations
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
In the name of God Computer Graphics.
Lecture 3 Transformations. 2D Object Transformations The functions used for modifying the size, location, and orientation of objects or of the camera.
Jinxiang Chai CSCE 441 Computer Graphics 3-D Viewing 0.
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
CS COMPUTER GRAPHICS LABORATORY. LIST OF EXPERIMENTS 1.Implementation of Bresenhams Algorithm – Line, Circle, Ellipse. 2.Implementation of Line,
David Luebke1/10/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis.
Affine Geometry.
Lecture 7 Midterm Review. OpenGL Libraries gl: Basic OpenGL library, e.g. primitives. glu: OpenGL Utility library, a set of functions to create texture.
Viewing and Projection. The topics Interior parameters Projection type Field of view Clipping Frustum… Exterior parameters Camera position Camera orientation.
Chapter 1 Graphics Systems and Models Models and Architectures.
CS 551 / 645: Introductory Computer Graphics Viewing Transforms.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Models and Architectures 靜宜大學 資訊工程系 蔡奇偉 副教授 2012.
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
Viewing. Classical Viewing Viewing requires three basic elements - One or more objects - A viewer with a projection surface - Projectors that go from.
Outline 3D Viewing Required readings: HB 10-1 to 10-10
Forward Projection Pipeline and Transformations CENG 477 Introduction to Computer Graphics.
- Introduction - Graphics Pipeline
In the name of God Computer Graphics.
3. Transformation
CSCE 441 Computer Graphics 3-D Viewing
3D Graphics Rendering PPT By Ricardo Veguilla.
CENG 477 Introduction to Computer Graphics
Models and Architectures
Models and Architectures
Models and Architectures
Introduction to Computer Graphics with WebGL
Models and Architectures
Models and Architectures
THREE-DIMENSIONAL VIEWING
Presentation transcript:

Basic graphics

ReviewReview Viewing Process, Window and viewport, World, normalized and device coordinates Input and output primitives and their attributes. Rendering. Vector and raster displays Basic graphics in an universal programming system Vector Algebra Homogeneous Coordinates and Transformation of Space

PreliminariesPreliminaries What newcomers to Shape Modeling and Computer Graphics have to know  Fundamental ideas and vocabulary in Geometrical Modeling and Computer graphics Graphics and geometry APIs Transformations Curves and surfaces design Rendering technique Physics-based approaches for modeling …

OverviewOverview Are they shadows that we see? And can shadows pleasure give? Pleasures only shadows be Cast by bodies we conceive And are made the things we deem In those figures which they seem From Are They Shadows by Samuel Daniel

3D Viewing Many of the 3D images seen on a screen are really a trick of the eye. The modeling is performed in 3D, but the rendering has to be converted to 2D

3D Viewing

A useful metaphor for creating 3D scenes is the motion of a synthetic camera We imagine that we can move our camera to any location, orient it in any way we wish, and, with a snap of the shutter, create a 2D image (“photo”) of a 3D object The camera, of course, is really just a computer program that produces an image on a display screen

3D Viewing Rendering is the process by which a computer creates images from models The rendering of 3D pictures is accomplished through projection: draw a line from the eye (P 0 ) with a straight line to the (x,y,z)

3D Viewing Creation of our “photo” is accomplished as a series of steps: Specification of projection type to transform 3D objects onto a 2D projection plane Specification of viewing parameters. We must specify the conditions under which we want to view the 3D real world dataset Clipping in three dimensions. We must ignore parts of the scene that are not candidates for ultimate display

3D Viewing Given that output primitives are specified in world coordinates, the graphics subroutine package must be told how to map world coordinates onto screen coordinates or device coordinates So if we have world-coordinate window, and a corresponding rectangular region in screen coordinates, called the viewport, we have to produce the transformation that maps the window into the viewport

3D Viewing We may want to ignore parts of the scene that are behind us or too far distant to be clearly visible The view volume bounds that portion of the world that is to be clipped out and projected onto the view plane

3D Viewing In the output pipeline, the application program takes description of objects in terms of primitives and attributes stored in or derived from an application model or data structure, and specifies them to the graphics package, which in turn clips and converts them to the pixels seen on the screen CG packages supports a basic collection of primitives: lines, polygons, circles and ellipses, and text

3D Viewing Raster displays store the display primitives in a refresh buffer in terms of the primitive’s component pixel Pixels are points of a rectangular array or the smallest visible elements that the display hardware can put on the screen

Basic graphics in an universal programming system (OpenGL) The OpenGL graphics system is a software interface to graphics hardware It allows you to create interactive programs that produce color images of moving three- dimensional objects With OpenGL, you must build up your desired model from a small set of geometric primitives – points, lines, and polygons

Basic graphics in an universal programming system (OpenGL) The OpenGL Utility Library (GLU) provides many of the modeling features, such as quadric surfaces and NURBS OpenGL is a state machine. You put it into various states that then remain in effect until you change them Many state variables refer to modes that are enabled or disabled

Basic graphics in an universal programming system (OpenGL) All data, whether it describes geometry or pixels, can be saved in a display list for current or later use All geometric primitives are eventually described by vertices. Parametric curves and surfaces may be initially described by control points. Evaluators provide a method to derive the vertices You can handle input events and register callback command that are invoked when specified events occur, for instance when the mouse is moved while a mouse button is also pressed

Basic graphics in an universal programming system (OpenGL) One of the most exciting things you can do on a graphical computer is draw pictures that move, or animate objects Most OpenGL implementation provide double- buffering – hardware or software that supplies two complete color buffers. Once is displayed while the other is being drawn. When the drawing of a frame is complete, the two buffers are swapped

Vector Algebra A vector is a mathematical entity with two attributes: direction and magnitude. The magnitude of vector P =(x,y,z) is |P| = The direction of a vector can be expressed by the cosines of the angles it makes with the coordinate axis x/|P|, y/ |P|, z/|P|. The three unit vectors in the directions of the coordinate axes are traditionally denoted i = (1,0,0), j = (0,1,0) and k = (0,0,1).

Vector Algebra Vectors permit two fundamental operations: You can add them and you can multiply them by scalars. Let a 1 = a 1 i, a 2 = a 2 j, a 3 = a 3 k, and b 1 = b 1 i, b 2 = b 2 j, b 3 = b 3 k. We can write a + b = (a 1 + b 1 )i + (a 2 + b 2 )j + (a 3 + b 3 )k, a = a 1 i + a 2 j + a 3 k. To form a linear combination of two vectors, a and b, we scale each of them by some scalars, say,  and  and add the weighted versions to form new vector,  a +  b.

Vector Algebra The dot product of two vectors. To calculate the dot product we multiply corresponding components of the vectors and add the result. The cross product (also called the vector product) of two vectors is another vector. Given the 3D vectors a = (a x,a y,a z ), and b = (b x,b y,b z ), their cross product is denoted as a  b or a  b. It is defined in terms of the standard unit vector i,j, and k by a  b = (a x b z – a z b y )i + (a z b x – a x b z )j + (a x b y – a y b x )k.

Vector Algebra Vector equation of line. Suppose we are given a point P 0 and a unit vector u along the line L. Give the names r 0 and r to the vectors OP 0 and OP connecting the point O with the point P 0 and an arbitrary point P, respectively. Then the vector P 0 P = r – r 0 coincides with the direction of the vector u, so r – r 0 = u. And we have r = r 0 + u.

Vector Algebra Vector differentiation. If a vector a is the function of time t, a(t) = a 1 (t) i + a 2 (t) j + a 3 (t) k, then = i + j + k.

Homogeneous Coordinates and Transformation of Space Each primitive has a mathematical representation which can be expressed as a data or type structure fore storage and manipulation by a computer Applying transformations to graphical primitives can be done by a process called instancing

ProjectionsProjections 3D objects can be projected on 2D view plane There are two basic methods: –parallel projection –perspective projection The parallel projection can be considered as a special case of of perspective projection

ProjectionsProjections Orthographic Parallel Projections The most common type of orthographic projection is the front- elevation

Homogeneous Coordinates and Transformation of Space A point (x, y, z) in three dimensional Cartesian space is represented in R 4 by the vector (x, y, z, 1), or by any multiple (rx, ry, rz,r) (with, r  0). When W  0, the homogeneous coordinates (X, Y. Z. W) represent the Cartesian point (x, y, z = (X/W, Y/W, Z/W) A point of the form (X, Y, Z,0) does not correspond to a Cartesian point, but represents the point at infinity in the direction of the three-dimensional vector (X, Y, Z). The set of all homogeneous coordinates (X, Y, Z. W) is called (three-dimensional) projective space and denoted P 3

Homogeneous Coordinates and Transformation of Space A transformation of projective space is a mapping L: P 3  P 3 of the form The 4  4 matrix M is called the homogeneous transformation matrix of L. If M is a non-singular matrix then L is called a non- singular transformation. If m 14 = m 24 = m 34 = 0 and m 44  0, then L is said to be an affine transformation. (Affine transformations correspond to translations, scalings, rotations etc. of three- dimensional Cartesian space.) A point of the form (X, Y, Z,0) does not correspond to a Cartesian point, but represents the point at infiniy

Homogeneous Coordinates and Transformation of Space Translations - The transformation matrix of a translation by x 0, y 0, and z 0 units in the x-, y- and z- directions respectively, is - Hence, P(x, y, z) is transformed to P'(x + x 0, y + y 0, z + z 0 )

Homogeneous Coordinates and Transformation of Space Scalings and Reflections - A scaling about the origin by a factor s x, s y, and s z, in the x-, y-, and z-direction,is respectively, obtained by the following transformation matrix - The transformation matrices of the reflections R yz in the x = 0 plane, R xz, in the y = 0 plane, and R xy in the z = 0 plane, are obtained by taking a scaling of -1 in one of the coordinate directions

Homogeneous Coordinates and Transformation of Space Rotations about the Coordinate Axes - Rotations in space take place about a line called its rotation axis - The rotations about the three coordinate axes are called the primary rotations 1. Rotation about the x-axis through an angle  x 2. Rotation about the y-axis through an angle  y 3. Rotation about the z-axis through an angle  z

Homogeneous Coordinates and Transformation of Space Rotation about an Arbitrary Line - Rotation through an angle  about an arbitrary rotation axis is obtained by transforming the rotation axis to one of the coordinate axes, applying a primary rotation through an angle  about the coordinate axis, and applying the transformation which maps the coordinate axis back to the rotation axis

Homogeneous Coordinates and Transformation of Space Rotation about an Arbitrary Line 1.Apply the translation T(-p l,-p 2 -p 3 ) which maps P to the origin and the rotation axis to the line OR where R(r 1,r 2,r 3 )= U 2.Suppose r 2 and r 3 are not both zero. Apply a rotation through all angle  x, about the x-axis so that the line OR is mapped into the xz-plane 3.Apply a rotation about the y-axis so that the line OR' is mapped to the z-axis. 4.Apply a rotation through an angle  about the z-axis (Figure 2(c)). 5.Apply the inverses of the transformations 1-3 in reverse order