Computer Graphics Programming: Matrices and Transformations CSE 3451 Matt Boggus.

Slides:



Advertisements
Similar presentations
OpenGL: Simple Use Open a window and attach OpenGL to it Set projection parameters (e.g., field of view) Setup lighting, if any Main rendering loop –Set.
Advertisements

COMP 175 | COMPUTER GRAPHICS Remco Chang1/6103b – Shapes Lecture 03b: Shapes COMP 175: Computer Graphics February 3, 2015.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Building Models modified by Ray Wisman Ed Angel Professor of Computer Science,
Understanding the graphics pipeline Lecture 2 Original Slides by: Suresh Venkatasubramanian Updates by Joseph Kider.
Graphics Pipeline.
CS 4363/6353 BASIC RENDERING. THE GRAPHICS PIPELINE OVERVIEW Vertex Processing Coordinate transformations Compute color for each vertex Clipping and Primitive.
HCI 530 : Seminar (HCI) Damian Schofield.
Drawing Geometric Objects
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Adv. Computer Graphics CS6500, Spring 2003.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Models and Architectures Ed Angel Professor of Computer Science, Electrical and Computer.
Ever wonder how they made STAR WARS or TOY STORY? The development of Computer Graphics is responsible for a revolution in art and media. Starting with.
Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)
3D Rendering with JOGL Introduction to Java OpenGL Graphic Library By Ricardo Veguilla
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Beyond Meshes Spring 2012.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Modeling and representation 1 – comparative review and polygon mesh models 2.1 Introduction 2.2 Polygonal representation of three-dimensional objects 2.3.
CSE 381 – Advanced Game Programming Basic 3D Graphics
Advanced Computer Graphics March 06, Grading Programming assignments Paper study and reports (flipped classroom) Final project No written exams.
Rujchai Ung-arunyawee Department of Computer Engineering Khon Kaen University.
Week 2 - Wednesday CS361.
Image Synthesis Rabie A. Ramadan, PhD 2. 2 Java OpenGL Using JOGL: Using JOGL: Wiki: You can download JOGL from.
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.
Graphics Systems and OpenGL. Business of Generating Images Images are made up of pixels.
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
OpenGL Conclusions OpenGL Programming and Reference Guides, other sources CSCI 6360/4360.
CSE 581: Interactive Computer Graphics Spring 2012, UG 4 Tuesday, Thursday – 9:00AM – 10:18AM DL 0317 Raghu Machiraju Slides: Courtesy - Prof. Huamin Wang,
Image Synthesis Rabie A. Ramadan, PhD 1. 2 About my self Rabie A. Ramadan My website and publications
CSE Real Time Rendering Week 2. Graphics Processing 2.
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
COMPUTER GRAPHICS CSCI 375. What do I need to know?  Familiarity with  Trigonometry  Analytic geometry  Linear algebra  Data structures  OOP.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
Representation. Objectives Introduce concepts such as dimension and basis Introduce coordinate systems for representing vectors spaces and frames for.
Game Programming 06 The Rendering Engine
1Computer Graphics Programming with OpenGL Three Dimensions – 2 Lecture 7 John Shearer Culture Lab – space 2
Computer Graphics Basic 3D Geometry CO2409 Computer Graphics Week 5-1.
Introduction to OpenGL  OpenGL is a graphics API  Software library  Layer between programmer and graphics hardware (and software)  OpenGL can fit in.
Control flow for interactive applications CSE 3541 Matt Boggus.
Image Synthesis Rabie A. Ramadan, PhD 4. 2 Review Questions Q1: What are the two principal tasks required to create an image of a three-dimensional scene?
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Vertices, Edges and Faces By Jordan Diamond. Vertices In geometry, a vertices is a special kind of point which describes the corners or intersections.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 15 Creating 3D Models.
Chapter 1 Graphics Systems and Models Models and Architectures.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Models and Architectures 靜宜大學 資訊工程系 蔡奇偉 副教授 2012.
OpenGL CS418 Computer Graphics John C. Hart. OpenGL Based on GL (graphics library) by Silicon Graphics Inc. (SGI) Advantages: Runs on everything, including.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Computer Graphics (Fall 2003) COMS 4160, Lecture 5: OpenGL 1 Ravi Ramamoorthi Many slides courtesy Greg Humphreys.
The Graphic PipeLine
Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics
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.
The Graphics Rendering Pipeline
Real-time Computer Graphics Overview
Models and Architectures
Models and Architectures
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
The Graphics Pipeline Lecture 5 Mon, Sep 3, 2007.
Lecture 13 Clipping & Scan Conversion
Angel: Interactive Computer Graphics5E © Addison-Wesley 2009
Models and Architectures
Models and Architectures
Game Programming Algorithms and Techniques
03 | Creating, Texturing and Moving Objects
Texture Mapping Jung Lee.
Introduction to Computer Graphics
Presentation transcript:

Computer Graphics Programming: Matrices and Transformations CSE 3451 Matt Boggus

Outline Computer graphics overview Types of 3D modeling – Solid – Shell/Boundary Unity Mesh objects

Computer Graphics Algorithmically generating a 2D image from 3D data (models, textures, lighting) Also called rendering Raster graphics – Array of pixels – About 25x25 in the example -> Algorithm tradeoffs: – Computation time – Memory cost – Image quality

Computer Graphics The graphics pipeline is a series of conversions of points into different coordinate systems or spaces

Computer Graphics Virtual cameras in Unity will handle everything from the viewing transformation on

Solid modeling Define the volume of an object Example: volume elements (voxels)

Shell/Boundary modeling Represent the surface of an object (i.e. the boundary between the solid volume and air)

OpenGL polygon modeling Legacy syntax example: glBegin(GL_POLYGON); glVertex2f(-0.5, -0.5); glVertex2f(-0.5, 0.5); glVertex2f(0.5, 0.5); glVertex2f(0.5, -0.5); glEnd();

Polygon winding order Clockwise Counter-clockwise Unity uses a clockwise winding order for determining front-facing polygons

Unity specifying geometry – Mesh class Requires two types of values – Vertices (specified as an array of 3D points) – Triangles (specified as an array of Vector3s whose values are indices in the vertex array) Documentation and Example – neratingMeshGeometryProcedurally.html neratingMeshGeometryProcedurally.html – nce/Mesh.html nce/Mesh.html The code on the following slides is attached to a cube game object (rather than an EmptyObject)

Mesh pt. 1 – assign vertices Mesh mesh = new Mesh(); gameObject.GetComponent ().mesh = mesh; Vector3[] vertices = new Vector3[4]; vertices[0] = new Vector3(0.0f, 0.0f, 0.0f); vertices[1] = new Vector3(width, 0.0f, 0.0f); vertices[2] = new Vector3(0.0f, height, 0.0f); vertices[3] = new Vector3(width, height, 0.0f); mesh.vertices = vertices;

Mesh pt. 2 – assign triangles int[] tri = new int[6]; // Lower left triangle of a quad tri[0] = 0; tri[1] = 2; tri[2] = 1; // Upper right triangle of a quad tri[3] = 2; tri[4] = 3; tri[5] = 1; mesh.triangles = tri;

More mesh values // Normal vectors (one per vertex) – for illumination Vector3[] normals = new Vector3[4]; // compute normals… mesh.normals = normals; // Texture coordinates (one per vertex) – for texturing Vector2[] uv = new Vector2[4]; // assign uvs… mesh.uv = uv; Side note: You can also use mesh.RecalculateNormals(); if you want Unity to try to compute normals for you.

Critical thinking – geometry modeling Which of the following statements is true? A.Smooth models like spheres are inexpensive to create B.A 3D model can be created faster than four hand drawn 2D images of the object from the front, back, and sides C.3D shapes can be constructed out of 2D primitives D.All meshes must be solid volumes