Graphics Graphics Korea University kucg.korea.ac.kr Geometric Primitives 고려대학교 컴퓨터 그래픽스 연구실.

Slides:



Advertisements
Similar presentations
Computer Graphics - Geometry & Representation -
Advertisements

Vectors, Points, Lines and Planes Jim Van Verth Lars M. Bishop
COMP 175 | COMPUTER GRAPHICS Remco Chang1/6103b – Shapes Lecture 03b: Shapes COMP 175: Computer Graphics February 3, 2015.
Vector Calculus Mengxia Zhu Fall Objective Review vector arithmetic Distinguish points and vectors Relate geometric concepts to their algebraic.
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
Graphics Graphics Korea University cgvr.korea.ac.kr 3D Object Representation 고려대학교 컴퓨터 그래픽스 연구실.
Math 1Hofstra University – CSC171A1 Modeling Objects by Polygonal Approximations Define volumetric objects in terms of surfaces patches that surround the.
Math Foundations of CG Math 1 Hofstra University.
Chapter 4.1 Mathematical Concepts
2/7/2001Hofstra University – CSC290B1 Review: Math (Ch 4)
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry Trigonometric functions Defined using right triangle  x y h.
CS5500 Computer Graphics March 22, Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Coordinate-Free Geometry When we learned simple.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Geometry Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and.
CSCE 590E Spring 2007 Basic Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
Math Foundations of CG Math 1 Hofstra University.
Math Foundations of CG Math 1 Hofstra University.
Transformations. 2 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Coordinate-Free Geometry When we learned simple geometry, most of us.
Vectors.
Geometric Objects and Transformations Geometric Entities Representation vs. Reference System Geometric ADT (Abstract Data Types)
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Graphics Graphics Korea University cgvr.korea.ac.kr 1.2 Notation and Definition 그래픽스 연구실 정병선.
CS 450: Computer Graphics REVIEW: OVERVIEW OF POLYGONS
Graphics CSE 581 – Interactive Computer Graphics Mathematics for Computer Graphics CSE 581 – Roger Crawfis (slides developed from Korea University slides)
Math Primer for CG Ref: Interactive Computer Graphics, Chap. 4, E. Angel.
Geometry CSC 2141 Introduction to Computer Graphics.
1 Geometry. 2 Objectives Introduce the elements of geometry ­Scalars ­Vectors ­Points Develop mathematical operations among them in a coordinate-free.
Modeling. Geometric Models  2D and 3D objects  Triangles, quadrilaterals, polygons  Spheres, cones, boxes  Surface characteristics  Color  Texture.
Fundamentals of Computer Graphics Part 4
1 Chapter 4 Geometric Objects and Transformation.
Mathematical Foundations Sections A-1 to A-5 Some of the material in these slides may have been adapted from university of Virginia, MIT and Åbo Akademi.
Graphics Graphics Korea University kucg.korea.ac.kr Transformations 고려대학교 컴퓨터 그래픽스 연구실.
Intro to 3D Models Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Mathematics for Graphics. 1 Objectives Introduce the elements of geometry  Scalars  Vectors  Points Develop mathematical operations among them in a.
Graphics Systems and OpenGL. Business of Generating Images Images are made up of pixels.
Geometric Objects and Transformation
Representation. Objectives Introduce concepts such as dimension and basis Introduce coordinate systems for representing vectors spaces and frames for.
16/5/ :47 UML Computer Graphics Conceptual Model Application Model Application Program Graphics System Output Devices Input Devices API Function.
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.
Background Mathematics Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006.
Geometric Objects and Transformations
CAP 4730 Computer Graphic Methods Prof. Roy Levow Chapter 4.
Vector Tools for Computer Graphics
1 Graphics CSCI 343, Fall 2015 Lecture 10 Coordinate Transformations.
Chun-Yuan Lin Mathematics for Computer Graphics 2015/12/15 1 CG.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Basic Entities Scalars - real numbers sizes/lengths/angles Vectors - typically 2D, 3D, 4D directions Points - typically 2D, 3D, 4D locations Basic Geometry.
1 Graphics CSCI 343, Fall 2015 Lecture 9 Geometric Objects.
1 Representation. 2 Objectives Introduce concepts such as dimension and basis Introduce coordinate systems for representing vectors spaces and frames.
CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
Computer Graphics I, Fall 2010 Building Models.
2/28/2016 CS 551 / 645: Introductory Computer Graphics Framebuffer Mathematical Foundations The Rendering Pipeline.
Computer Graphics I, Fall 2010 Geometry.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Geometry.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Graphics Graphics Korea University kucg.korea.ac.kr Mathematics for Computer Graphics 고려대학교 컴퓨터 그래픽스 연구실.
4. Geometric Objects and Transformations
Modeling Transformations Mario Costa Sousa University of Calgary CPSC 453, Fall 2001 Mario Costa Sousa University of Calgary CPSC 453, Fall 2001.
Unit-4 Geometric Objects and Transformations- I
Math Fundamentals Maths revisit.
Mathematics for Computer Graphics
CSC461: Lecture 12 Geometry Objectives
Introduction to Computer Graphics with WebGL
Angel: Interactive Computer Graphics5E © Addison-Wesley 2009
Angel: Interactive Computer Graphics5E © Addison-Wesley 2009
PPT&Programs
Geometric Objects and Transformations (I)
3D Object Representation
Presentation transcript:

Graphics Graphics Korea University kucg.korea.ac.kr Geometric Primitives 고려대학교 컴퓨터 그래픽스 연구실

KUCG Graphics Korea University kucg.korea.ac.kr Scalar, Points, and Vectors Scalar real number ex) length of line segment Points location in space fundamental geometric object Vectors quantity with direction and magnitude ex) velocity, force

KUCG Graphics Korea University kucg.korea.ac.kr Mathematical View Vector space entities: vectors and scalars operations: vector-vector addition, vector-scalar multiplication Affine space entities: vectors, scalars, and points operations: vector-vector addition, vector-scalar multiplication, vector-point addition, point-point subtraction Euclidean space + measure of size or distance

KUCG Graphics Korea University kucg.korea.ac.kr Geometric ADTs (1/2) ADT: abstract data type Entities scalars: real numbers points: locations in space vectors: directed line segments Operations magnitude  magnitude of a vector: real number  magnitude of vector-scalar multiplication  zero magnitude: zero vector

KUCG Graphics Korea University kucg.korea.ac.kr Geometric ADTs (2/2) Operations (cont’) subtraction of two points – yields a vector point-vector addition vector-vector addition  visualization:head-to-tail rule u+v v u P – R P – Q Q – R P Q R

KUCG Graphics Korea University kucg.korea.ac.kr Lines Line in an affine space sum of a point and a vector subtraction of two points

KUCG Graphics Korea University kucg.korea.ac.kr Affine Sums In affine space O: vector-vector addition, vector-scalar multiplication, vector-point addition X: addition of two points, point-scalar multiplication Affine addition

KUCG Graphics Korea University kucg.korea.ac.kr Convexity Convex object any point lying on the line segment connecting any two points in the object is also in the object (chap.2) Use affine sums convex object such as line segment convex hull P(α) Q R

KUCG Graphics Korea University kucg.korea.ac.kr Dot Products Inner products – orthogonal: magnitude of a vector: angle between two vectors: orthogonal projection: v θ u |v|cosθ

KUCG Graphics Korea University kucg.korea.ac.kr Cross Products Outer products – right-handed coordinates system  direction of the thumb of the right hand v u u  v

KUCG Graphics Korea University kucg.korea.ac.kr Planes Extension of line P Q R normal to the plane P0P0 v u n P

KUCG Graphics Korea University kucg.korea.ac.kr 3D Primitives (1/2) Curves, surfaces, volumetric objects Curves Volumetric objects Surfaces

KUCG Graphics Korea University kucg.korea.ac.kr 3D Primitives (2/2) Three conditions of 3D objects to fit well with existing computer graphics hardware and software described by surface and thought of as being hollow  need 2D primitives to model 3D objects specified through a set of vertices in 3D  use a pipeline architecture to process vertices at high rate composed of or approximated by flat convex polygons  most graphics system require that user specify simple planner polygons  tessellation, exception – CSG

KUCG Graphics Korea University kucg.korea.ac.kr CSG Constructive solid geometric build object from a small set of volumetric objects through set operations union intersection

KUCG Graphics Korea University kucg.korea.ac.kr Coordinate Systems 3D vector space scalar component :  1,  2,  3 basis vector : v 1, v 2, v 3  define a coordinate system  the origin : fixed reference point representation: column matrix v2v2 v1v1 v3v3 Coordinate System

KUCG Graphics Korea University kucg.korea.ac.kr Frames Basis set of vectors and a particular point P 0 more general representation fix the origin at P 0 homogeneous coordinates  avoid the difficulties caused by vectors having magnitude and direction but no fixed position  represent points and vectors with matrices  maintain a distinction between points and vectors vector : point : v2v2 v1v1 v3v3 Frame origin

KUCG Graphics Korea University kucg.korea.ac.kr Changes of Coordinate Systems (1/2) Two basis: { v 1, v 2, v 3 }, { u 1, u 2, u 3 } matrix

KUCG Graphics Korea University kucg.korea.ac.kr Changes of Coordinate Systems (2/2) Vector: w

KUCG Graphics Korea University kucg.korea.ac.kr Change of Basis Origin unchanged rotation and scaling of a set of basis vectors Origin changed translation of the origin, or change of frame  homogeneous coordinates v2v2 v1v1 v3v3 v’ 2 v’ 1 v’ 3 v2v2 v1v1 v3v3 v’ 2 v’ 1 v’ 3

KUCG Graphics Korea University kucg.korea.ac.kr Example of Change Basis (1/2) Suppose a vector: w  a = [ ] T 3 basis vectors : v 1, v 2, v 3 new basis : u 1, u 2, u 3

KUCG Graphics Korea University kucg.korea.ac.kr Example (2/2) Change of basis

KUCG Graphics Korea University kucg.korea.ac.kr Homogeneous Coordinates (1/2) Confusion between points and vectors !! Point P and vector v in frame ( v 1, v 2, v 3, P 0 )

KUCG Graphics Korea University kucg.korea.ac.kr Homogeneous Coordinates (2/2) Change of frames ( v 1, v 2, v 3, P 0 ), ( u 1, u 2, u 3, Q 0 )

KUCG Graphics Korea University kucg.korea.ac.kr Example of Change in Frames Change of frames ( v 1, v 2, v 3, P 0 ), ( u 1, u 2, u 3, Q 0 ) Point p = [ ] T  p’ = [ ] T

KUCG Graphics Korea University kucg.korea.ac.kr Another Example Change of frames ( v 1, v 2, v 3, P 0 ), ( u 1, u 2, u 3, Q 0 ) Point p = [ ] T  p’ = [ ] T

KUCG Graphics Korea University kucg.korea.ac.kr Drawing a Rotating Cube Tasks to generate the image modeling converting to the camera frame clipping projecting removing hidden surfaces rasterizing

KUCG Graphics Korea University kucg.korea.ac.kr Modeling a Cube Surface-based model outward-pointing face  right-hand rule: counterclockwise order Data structure geometry: location of vertices topology: connectivity GLfloat vertices[8][3]= { {-1.0, -1.0, -1.0}, {1.0, -1.0, -1.0}, {1.0, 1.0, -1.0}, {-1.0, 1.0, -1.0}, {-1.0, -1.0, 1.0}, {1.0, -1.0, 1.0}, {1.0, 1.0, 1.0}, {-1.0, 1.0, 1.0}}; glBegin(GL_POLYGON); glVertex3fv(vertices[0]); glVertex3fv(vertices[3]); glVertex3fv(vertices[2]); glVertex3fv(vertices[1]); glEnd();

KUCG Graphics Korea University kucg.korea.ac.kr Color Cube (1/2) typedef Glfloat point3[3]; Point3 vertices[8]= { {-1.0, -1.0, -1.0}, {1.0, -1.0, -1.0}, {1.0, 1.0, -1.0}, {-1.0, 1.0, -1.0}, {-1.0, -1.0, 1.0}, {1.0, -1.0, 1.0}, {1.0, 1.0, 1.0}, {-1.0, 1.0, 1.0}}; Glfloat colors[8][3] = { {0.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0}, {1.0, 0.0, 1.0}, {1.0, 1.0, 1.0}, {0.0, 1.0, 1.0}}; void quad(int a, int b, int c, int d) { glBegin(GL_QUADS); glColor3fv(colors[a]); glVertex3fv(vertices[a]); glColor3fv(colors[b]); glVertex3fv(vertices[b]); glColor3fv(colors[c]); glVertex3fv(vertices[c]); glColor3fv(colors[d]); glVertex3fv(vertices[d]);

KUCG Graphics Korea University kucg.korea.ac.kr Color Cube (2/2) Bilinear interpolation glEnd(); } void display() { quad(0, 3, 2, 1); quad(2, 3, 7, 6); quad(0, 4, 7, 3); quad(1, 2, 6, 5); quad(4, 5, 6, 7); quad(0, 1, 5, 4); } C1C1 C2C2 C3C3 C0C0 C 23 (α) C 01 (α) C 45 (α) C4C4 C5C5