Mathematics in Computer Graphics and Games. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Similar documents
Computer Graphics (CS 543) Lecture 4a: Introduction to Transformations

Computer Graphics (CS 543) Lecture 2c: Fractals. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Computer Graphics 4731 Lecture 5: Fractals. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Computer Graphics CS 543 Lecture 1 (Part I) Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Computer Graphics (CS 543) Lecture 1 (Part 1): Introduction to Computer Graphics

Transformations. Prof. George Wolberg Dept. of Computer Science City College of New York

CS 543: Computer Graphics. Introduction

Weeks 1 3 Weeks 4 6 Unit/Topic Number and Operations in Base 10

Computer Graphics (CS 543) Lecture 7b: Intro to lighting, Shading and Materials + Phong Lighting Model

Computer Graphics (CS 4731) Lecture 16: Lighting, Shading and Materials (Part 1)

CS 543: Computer Graphics. 3D Transformations

Module Contact: Dr Rudy Lapeer (CMP) Copyright of the University of East Anglia Version 1

Recall: Indexing into Cube Map

Cassia County School District #151. Expected Performance Assessment Students will: Instructional Strategies. Performance Standards

Computer Graphics (CS 543) Lecture 10: Soft Shadows (Maps and Volumes), Normal and Bump Mapping

Smarter Balanced Assessment Consortium Claims, Targets, and Standard Alignment for Math

CS 543: Computer Graphics Lecture 3 (Part I): Fractals. Emmanuel Agu

Computer Graphics (CS 543) Lecture 9 (Part 2): Clipping. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

We will now take a closer look at the ideas behind the different types of symmetries that we have discussed by studying four different rigid motions.

Colorado School of Mines. Computer Vision. Professor William Hoff Dept of Electrical Engineering &Computer Science.

Fractals & Iterative Function Systems

3D GRAPHICS. design. animate. render

CHAPTER 1 Graphics Systems and Models 3

Computer Aided Drafting, Design and Manufacturing Volume 26, Number 2, June 2016, Page 13

CS 543: Computer Graphics Midterm review. Emmanuel Agu

Smarter Balanced Assessment Consortium Claims, Targets, and Standard Alignment for Math

Structural Balance in Networks. An Optimizational Approach. Andrej Mrvar. Faculty of Social Sciences. University of Ljubljana. Kardeljeva pl.

Computer Graphics (CS 543) Lecture 13b Ray Tracing (Part 1) Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Computer Graphics (CS 543) Lecture 8 (Part 1): Physically-Based Lighting Models

Computer Graphics CS 543 Lecture 13a Curves, Tesselation/Geometry Shaders & Level of Detail

In this lesson, students build fractals and track the growth of fractal measurements using tables and equations. Enduring Understanding

TensorFlow and Keras-based Convolutional Neural Network in CAT Image Recognition Ang LI 1,*, Yi-xiang LI 2 and Xue-hui LI 3

CS 543: Computer Graphics Lecture 4 (Part I): 3D Affine transforms. Emmanuel Agu

Construction of a regular hendecagon by two-fold origami

CMSC427 Final Practice v2 Fall 2017

Computer Graphics (CS 543) Lecture 8a: Per-Vertex lighting, Shading and Per-Fragment lighting

Feature Based Registration for Panoramic Image Generation

Examples of Chaotic Attractors and Their Fractal Dimension

FRACTALS AND THE SIERPINSKI TRIANGLE

Painter s HSR Algorithm

3.6: First Person Computer Games

Novel Image Representation and Description Technique using Density Histogram of Feature Points

(Geometric) Camera Calibration

Relief shape inheritance and graphical editor for the landscape design

TEACHING PLAN FAKULTI TEKNOLOGI MAKLUMAT DAN KOMUNIKASI UNIVERSITI TEKNIKAL MALAYSIA MELAKA

Interactive Computer Graphics A TOP-DOWN APPROACH WITH SHADER-BASED OPENGL

Computer Graphics CS 543 Lecture 4 (Part 2) Building 3D Models (Part 2)

Affine Invariant Texture Analysis Based on Structural Properties 1

Procedural modeling and shadow mapping. Computer Graphics CSE 167 Lecture 15

KS3 Maths Progress Delta 2-year Scheme of Work

A wireless sensor network for visual detection and classification of intrusions

Computer Graphics (CS 4731) Lecture 18: Lighting, Shading and Materials (Part 3)

Object Representation Affine Transforms. Polygonal Representation. Polygonal Representation. Polygonal Representation of Objects

GLOBAL EDITION. Interactive Computer Graphics. A Top-Down Approach with WebGL SEVENTH EDITION. Edward Angel Dave Shreiner

COMP Preliminaries Jan. 6, 2015

Project 2: 3D transforms and Cameras

Computer Graphics (CS 543) Lecture 10: Normal Maps, Parametrization, Tone Mapping

CS324e -Elements of Graphics and Visualization. Fractals and 3D Landscapes

Computer Graphics (CS 543) Lecture 4a: Linear Algebra for Graphics (Points, Scalars, Vectors)

CS451Real-time Rendering Pipeline

CS Computer Graphics: Introduction to Ray Tracing

CS Computer Graphics: Introduction to Ray Tracing

Gromov-Hausdorff Distance Between Metric Graphs

Computer Graphics (CS 543) Lecture 9b: Shadows and Shadow Maps. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Homework #2. Shading, Projections, Texture Mapping, Ray Tracing, and Bezier Curves

Fog example. Fog is atmospheric effect. Better realism, helps determine distances

(Refer Slide Time: 00:01:27 min)

A simplified approach to merging partial plane images

Nonphotorealism. Christian Miller CS Fall 2011

Computer Graphics (CS 543) Lecture 8c: Environment Mapping (Reflections and Refractions)

Prove Theorems about Lines and Angles

Weeks 1 3 Weeks 4 6 Unit/Topic Topic: Topic: Number and Operations in Base 10

Clustering. Cluster Analysis of Microarray Data. Microarray Data for Clustering. Data for Clustering

Computer Graphics (CS 4731) OpenGL/GLUT (Part 2)

Medical Biophysics 302E/335G/ st1-07 page 1

Texture. Texture Mapping. Texture Mapping. CS 475 / CS 675 Computer Graphics. Lecture 11 : Texture

3D Programming. 3D Programming Concepts. Outline. 3D Concepts. 3D Concepts -- Coordinate Systems. 3D Concepts Displaying 3D Models

CS 475 / CS 675 Computer Graphics. Lecture 11 : Texture

Computer Graphics (4731) Lecture 4: 2D Graphics Systems (Drawing Polylines, tiling, & Aspect Ratio)

A Discrete Spring Model to Generate Fair Curves and Surfaces

Homework #2 and #3 Due Friday, October 12 th and Friday, October 19 th

A Non-greedy Decision Tree Algorithm. Kristin P. Bennett. Rensselaer Polytechnic Institute. Troy, NY 12180

Computer Graphics (CS 4731) Lecture 11: Implementing Transformations. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Introduction to Geometry. Computer Graphics CMU /15-662

Fractals and the Chaos Game

Resolution. Super-Resolution Imaging. Problem

Midterm Exam Fundamentals of Computer Graphics (COMP 557) Thurs. Feb. 19, 2015 Professor Michael Langer

Solid models and fractals

C P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE. Mikhail Bessmeltsev

Graphing a Reflection Image

Advanced Lighting Techniques Due: Monday November 2 at 10pm

Computer Graphics CS 543 Lecture 5 (Part 2) Implementing Transformations

Computer Graphics (CS 4731) Lecture 11: Implementing Transformations. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Automatic Graph Drawing Algorithms

Math 9: Chapter Review Assignment

Illumination & Shading I

Computer Graphics (CS 543) Lecture 6a: Hierarchical 3D Models. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Technical Arts 101 Prof. Anupam Saxena Department of Mechanical engineering Indian Institute of Technology, Kanpur. Lecture - 7 Think and Analyze

Use of LINK information

An Integrated Processing Method for Multiple Large-scale Point-Clouds Captured from Different Viewpoints

Transcription:

Matheatics in Coputer Graphics and Gaes Prof Eanuel Agu Coputer Science Dept. Worcester Polytechnic Institute (WPI)

About Me Professor in WPI Coputer Science Dept Grad school at Uass Aherst (MS, PhD) Research in Coputer graphics for years Teaching coputer graphics for 4 years

What is Coputer Graphics (CG)? Coputer graphics: algoriths, atheatics, progras.. that coputer uses to generate PRETTY PICTURES E.g Techniques to draw a line, polygon, cube Coputer-Generated! Not a picture!

Uses of Coputer Graphics Entertainent: gaes Courtesy: Super Mario Galaxy Courtesy: Final Fantasy XIV

Uses of Coputer Graphics ovies, TV (special effects, aniated characters) Courtesy: Shrek Courtesy: Spideran Note: Gaes and Movie industries Are two biggest hirers of coputer Graphics professionals!!

Uses of Coputer Graphics Displaying Matheatical Functions E.g., Matheatica

Main Career Paths in Coputer Graphics. Artist: Designs characters No ath skills required!!. Prograer: Writes progras to Make characters ove, talk, etc Lots of ath, prograing skills required!! Your students probably Follow prograer path

Soe High School Math Used in CG Geoetry Linear algebra: Matrices, vectors Trigonoetry Coplex nubers Boolean logic Probability

Fractals Matheatical expressions to generate pretty pictures Evaluate ath functions to create drawings Evaluated function approached infinity -> converge to iage i.e f(), f(), f(3).. F( ) Fractal iage exhibits self-siilarity: See siilar sub-iages within iage as we zoo in

Sierpinski Gasket: Popular Fractal (x3, y3) Start with initial triangle with corners (x, y) (x, y). Pick initial point p = (x, y) at rando inside triangle. Randoly select of 3 vertices 3. Find q, halfway between p and randoly selected vertex 4. Draw dot at q 5. Replace p with q 6. Return to step

Exaple: Fractal Terrain Terrain designed with only fractals

Exaple: Fractal Art Courtesy: Internet Fractal Art Contest

Exaple: Mandelbrot Set

Mandelbrot Set Function of interest: Pick constants s and c Orbit: sequence of values (i.e d, d, d 3, d 4, etc): Question: does the orbit converge to a value? c s z f ) ( ) ( c c c c s d c c c s d c c s d c s d 4 3 ) ) ) ) (((( ) ) ) ((( ) ) (( ) (

Mandelbrot Set Exaples orbits: s =, c = -, orbit =,-,,-,,-,,-,..finite s =, c =, orbit =,,,5,6,677 explodes Orbit depends on s and c Basic question: For given s and c, does function stay finite? (within Mandelbrot set) explode to infinity? (outside Mandelbrot set) Definition: if d <, orbit is finite else inifinite

Mandelbrot Set Mandelbrot set: use coplex nubers for c and s Set s =, c as a coplex nuber E.g: s =, c =. +.5i Definition: Mandelbrot set includes all finite orbit c Mandelbrot set progra: Choose s and c, progra calculates d, d, d 3, d 4 and tests if they are finite Choose colors Values of c in andelbrot set

Other Fractal Exaples Gingerbread Man The Fern

Geoetric Representations: 3D Shapes Generated using closed for geoetric equations Exaple: Sphere Sphere Cone Torus Proble: A bit restrictive to design real world scenes ade of spheres, cones, etc

Geoetric Representations: Meshes Collection of polygons, or faces, that for skin of object More flexible, represents coplex surfaces better Mesh? List of (x,y,z) points + connectivity Digitize real objects: very fine esh Each face of esh is a polygon Digitized esh of statue of Lucy: 8 illion faces

Affine Transforations Translation Scaling Rotation Shear Rotate object Translate object Scale object

Affine Transfors: General Approach We can transfor (translation, scaling, rotation, shearing, etc) object by applying atrix ultiplications to object vertices Transfored Vertex Px ' Py ' P ' z 3 3 3 3 33 Transfor Matrix 4 4 34 Px Py P z Original Vertex Note: point (x,y,z) needs to be represented as (x,y,z,), also called Hoogeneous coordinates

3D Translation using Matrices Move each object vertex by sae distance d = (d x, d y, d z ) Exaple: If we translate a point (,,) by displaceent (,4,6), new location of point is (4,6,8) Translate object 8 6 4 6 4 Translation Matrix Original point Translated point Translate x: + = 4 Translate y: + 4 = 6 Translate z: + 6 = 4 ' ' ' z y x z y x d d d z y x * General for

Scaling Transfor Expand or contract along each axis (fixed point of origin) Exaple: If we scale a point (,4,6) by scaling factor (.5,.5,.5) Scaled point position = (,, 3) 6 4.5.5.5 3 Scale Matrix for Scale(.5,.5,.5) Scaled x: x.5 = Scaled y: 4 x.5 = Scaled z: 6 x.5 = 3 ' ' ' z y x S S S z y x z y x General For

Why Matrices? Sequence of transfor atrices can be pre-ultiplied One final resulting atrix applied (efficient!) E.g. transfor x transfor. Q Q Q x y z 3 3 3 3 33 4 4 34 3 3 3 3 33 4 4 34 Px Py Pz Transfored Point Transfor Matrices can Be pre-ultiplied Original Point Coputer graphics card has fast 4x4 atrix ultiplier!!!

Why do we need Shading? Sphere without lighting & shading: Sphere with shading: Has visual cues for huans (shape, light position, viewer position, surface orientation, aterial properties, etc)

What Causes Shading? Shading caused by different angles with light, caera at different points

Calculating Shade Based on Labert s Law: D = I x k D cos (q) Calculate shade based on angle q q Receive ore light Receive less light Represent light direction, surface orientation as vectors Calculate q? Angle between vectors

Shading: Diffuse Light Exaple Different parts of each object receives different aounts of light

References Angel and Shreiner, Interactive Coputer Graphics (6 th edition), Chapter Hill and Kelley, Coputer Graphics using OpenGL (3 rd edition), Chapter