Basic 3D Concepts. Overview 1.Coordinate systems 2.Transformations 3.Projection 4.Rasterization.

Slides:



Advertisements
Similar presentations
Today Composing transformations 3D Transformations
Advertisements

Graphics Pipeline.
Three Dimensional Viewing
3D Graphics Rendering and Terrain Modeling
Shared Graphics Skills Cameras and Clipping Planes
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.
HCI 530 : Seminar (HCI) Damian Schofield.
3-D Geometry.
Cameras, lenses, and calibration
CHAPTER 7 Viewing and Transformations © 2008 Cengage Learning EMEA.
Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)
Geometric Objects and Transformations Geometric Entities Representation vs. Reference System Geometric ADT (Abstract Data Types)
Introduction to 3D Graphics John E. Laird. Basic Issues u Given a internal model of a 3D world, with textures and light sources how do you project it.
CS 450: COMPUTER GRAPHICS 3D TRANSFORMATIONS SPRING 2015 DR. MICHAEL J. REALE.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Introduction to 3D Computer Graphics and Virtual Reality McConnell text.
Basics of Rendering Pipeline Based Rendering –Objects in the scene are rendered in a sequence of steps that form the Rendering Pipeline. Ray-Tracing –A.
University of Illinois at Chicago Electronic Visualization Laboratory (EVL) CS 426 Intro to 3D Computer Graphics © 2003, 2004, 2005 Jason Leigh Electronic.
COMP 175: Computer Graphics March 24, 2015
Viewing and Projections
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
3D Programming Concepts How objects are described in 3D and Rendering Pipelines – A conceptual way of thinking of the steps involved of converting an abstract.
CSE 381 – Advanced Game Programming Basic 3D Graphics
3D Objects Subject:T0934 / Multimedia Programming Foundation Session:12 Tahun:2009 Versi:1/0.
CS 445 / 645 Introduction to Computer Graphics Lecture 3 Mathematical Primitives Introduction to Transformations Lecture 3 Mathematical Primitives Introduction.
Week 2 - Wednesday CS361.
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.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
CS559: Computer Graphics Lecture 9: Projection Li Zhang Spring 2008.
CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
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.
CAP4730: Computational Structures in Computer Graphics 3D Transformations.
10/3/02 (c) 2002 University of Wisconsin, CS 559 Last Time 2D Coordinate systems and transformations.
The Rendering Pipeline CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
CS 450: COMPUTER GRAPHICS PROJECTIONS SPRING 2015 DR. MICHAEL J. REALE.
10/7/04© University of Wisconsin, CS559 Fall 2004 Last Time Transformations Homogeneous coordinates Directions Rotation Geometry 101 – Points, edges, triangles/polygons.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
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.
Mark Nelson 3d projections Fall 2013
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Jinxiang Chai CSCE 441 Computer Graphics 3-D Viewing 0.
2/19/04© University of Wisconsin, CS559 Spring 2004 Last Time Painterly rendering 2D Transformations –Transformations as coordinate system changes –Transformations.
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
Computer vision: models, learning and inference M Ahad Multiple Cameras
Rendering Pipeline Fall, D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.
Taxonomy of Projections FVFHP Figure Taxonomy of Projections.
Affine Geometry.
1 Perception and VR MONT 104S, Fall 2008 Lecture 20 Computer Graphics and VR.
CS559: Computer Graphics Lecture 9: 3D Transformation and Projection Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
Viewing and Projection. The topics Interior parameters Projection type Field of view Clipping Frustum… Exterior parameters Camera position Camera orientation.
Computer Graphics One of the central components of three-dimensional graphics has been a basic system that renders objects represented by a set of polygons.
CS 551 / 645: Introductory Computer Graphics Viewing Transforms.
Viewing. Classical Viewing Viewing requires three basic elements - One or more objects - A viewer with a projection surface - Projectors that go from.
3D Ojbects: Transformations and Modeling. Matrix Operations Matrices have dimensions: Vectors can be thought of as matrices: v=[2,3,4,1] is a 1x4 matrix.
Forward Projection Pipeline and Transformations CENG 477 Introduction to Computer Graphics.
Introduction to Computer Graphics
Chapter 11 Three-Dimensional Geometric and Modeling Transformations
Visible Surface Detection
- Introduction - Graphics Pipeline
Intro to 3D Graphics.
CSCE 441 Computer Graphics 3-D Viewing
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.
3D Graphics Rendering PPT By Ricardo Veguilla.
CENG 477 Introduction to Computer Graphics
CS451Real-time Rendering Pipeline
Three Dimensional Viewing
Chapter V Vertex Processing
Game Programming Algorithms and Techniques
Presentation transcript:

Basic 3D Concepts

Overview 1.Coordinate systems 2.Transformations 3.Projection 4.Rasterization

ESTABLISHING A COORDINATE SYSTEM

Representing the 3D world  Typically, objects in our world consist of groups of triangles.  face = set of one or more contiguous coplanar adjacent triangles. adjacency?  How do we represent triangles?

Representing the 3D world  How do we represent triangles? By 3 points - the 3 vertices of the triangle.  How are the points represented?

Representing the 3D world  How are the points represented? Since we are in 3D space, each point is a vector consisting of 3 values,, in a cartesian coordinate system. (scalar, vector, matrix) 2D3D

Representing the 3D world  In TorqueScript, a vector is represented by a list/string of (typically) 3 numbers separated by a space. Example $fred = “ ”; $c0 = getword( $fred, 0 ); echo( $c0 ); //what does this print?

Representing the 3D world  Unity, uses the Vector3 class. example (JavaScript) var aPosition = Vector3(1, 1, 1); example (C#) using UnityEngine; using System.Collections; public class example : MonoBehaviour { public Vector3 aPosition = new Vector3( 1, 1, 1 ); }

Unity’s Vector3 class  This structure is used throughout Unity to represent D positions and directions.  It also contains functions for doing common vector operations.  See tation/ScriptReference/Vector3.html for more information. tation/ScriptReference/Vector3.html

Unity’s Vector3 class  class variables: one, zero, forward, up, right  instance variables: x, y, z  methods: scale, normalize, cross, dot, reflect, distance, etc.  operators: +, -, *, /, ==, !=

Representing the 3D world  How does a vector such as “ ” map into the “real” world?  We don’t (yet) know if 1 above specifies the H, W, or D!  Furthermore, we don’t know the relationship (l or r, u or d, f or b) between “ ” and “ ”

Representing the 3D world  How does a vector map into the “real” world?  Let’s establish a coordinate system  Left is left-handed; right is right-handed.  Index is +z, thumb is +y, middle is +x.

Representing objects  Objects (models) are composed of polygons which are composed of triangles.  But these triangles aren’t arbitrary!

Representing objects  Objects (models) are composed of polygons which are composed of triangles.  But these triangles aren’t arbitrary!

Representing the 3D world  We don’t know where our object will be placed in the world. It may even move in the world! We may have more than one in the world too!  So we don’t/can’t fix the object coordinates in terms of world coordinates!  But we need to specify each of the triangle vertices as numbers.  So what can we do?

Representing the 3D world  So we don’t/can’t fix the object coordinates in terms of world coordinates!  But we need to specify each of the triangle vertices as numbers.  So what can we do?  Each object has it’s own object coordinate system with it’s own origin (0,0,0).  So where is the model origin?

Representing the 3D world  Each object has it’s own object coordinate system with it’s own origin (0,0,0).  So where is the model origin?  Anywhere! It can be any point on (or not on) the object. 1.It can be the left-most (or right-most or top-most or …) point on the object. 2.It can be the geometric center (centroid/center of mass) of the object.

Representing the 3D world  Typically, it is the geometric center (centroid/center of mass) of the object. Let P be the set of points in the object. Let P i = be a particular point. How can we calculate the centroid of an object?

Representing the 3D world  Typically, it is the geometric center (centroid/center of mass) of the object. Let P be the set of points in the object. Let P i = be a particular point. How can we calculate the centroid of an object?

Representing the 3D world  Interesting property of the centroid: This may not even be a point on the object! Can you think of a real world object with a center that isn’t on the object?

TRANSFORMATIONS

Transformation  Conversion from object coordinates to world coordinates. Consists of:  Rotation  Translation  Scale

Transformation  Translation

Transformation  Scale

Transformation  Rotation

Representing the 3D world  In Unity, the Transform Component determines the actual Position, Rotation, and Scale of all objects in the scene.  Every object has a Transform.

Representing the 3D world  In Unity, … Position  X, Y, and Z coordinates Rotation  around the X, Y, and Z axes, measured in degrees Scale  along X, Y, and Z axes  A value "1" is the original size (size at which the object was imported).

Representing the 3D world  In Unity, … All properties of a Transform are measured relative to the Transform's parent. If the Transform has no parent, the properties are measured relative to World Space.

PROJECTION

Problem We have a 3D world consisting of height, width, and depth which is displayed on a 2D computer screen consisting only of height and width!

Projection  Remember that our world is 3D and the computer monitor is 2D.  Projection is the conversion from world coordinates to screen coordinates. Types: 1.parallel (orthographic) 2.perspective

Parallel (orthographic) projection  The distance from the camera doesn't affect how large an object appears.

Perspective projection  The further an object is from the camera (viewpoint), the smaller it appears.  Similar to how our eye and how a camera works.

Controlling perspective projection In both scenes, the fence appears to be relatively close, but the mountains vary greatly.

Controlling perspective projection

Entire transformation process

RASTERIZATION

Rendering (rasterization)  But that’s not all there is to do!  All we’ve done so far is to project the vertices of triangles onto the screen.  What about the points in between (the vertices)?  What about color?  What about light sources?

Rendering (rasterization)  The process of converting the 3D model of an object into an on-screen 2D image.  Note: This is most often done by the video card hardware for speed.

Rendering examples

Note uniformity across face of triangle.

Rendering Steps: 1.transformation 2.projection 3.scan conversion (filling in the triangles)  involves shading the surface (considers the orientation of the surface w.r.t. the location of the light(s))

Rendering  Typically involves a z-buffer (because many points may be projected to the same point on the screen).

PHEW!