Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab 9: 3D & Projections Basics.

Slides:



Advertisements
Similar presentations
Principles of Computer-Aided Design and Manufacturing Second Edition 2004 ISBN Author: Prof. Farid. Amirouche University of Illinois-Chicago.
Advertisements

Three Dimensional Viewing
1 Computer Graphics Chapter 8 3D Transformations.
1 of 19 New Lecture And Lab Information Lectures: –Thursday 13:00 – 14:00 (A322) Does anyone miss lunch? –Friday 15:00 – 16:00 (A28) Labs: –Wednesday 10:00.
CS485/685 Computer Vision Prof. George Bebis
Lecture 12: Projection CS4670: Computer Vision Noah Snavely “The School of Athens,” Raphael.
Viewing Transformations
The Pinhole Camera Model
Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.
3D Concepts UNIT 3. 3-D Coordinate Spaces Remember what we mean by a 3-D coordinate space x axis y axis z axis P y z x Right-Hand Reference System.
1 Chapter 5 Viewing. 2 Perspective Projection 3 Parallel Projection.
Visualization- Determining Depth From Stereo Saurav Basu BITS Pilani 2002.
1 of 23 New Lecture And Lab Information Lectures: –Thursday 12:00 – 13:00 (room tba) –Friday 15:00 – 16:00 (A28) Labs: –Wednesday 10:00 – 11:00 (A305)
Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)
12.1 Si23_03 SI23 Introduction to Computer Graphics Lecture 12 – 3D Graphics Transformation Pipeline: Projection and Clipping.
COMP 175: Computer Graphics March 24, 2015
Viewing and Projections
Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.
Week 2 - Wednesday CS361.
Transformation & Projection Feng Yu Proseminar Computer Graphics :
Graphics Graphics Korea University cgvr.korea.ac.kr 3D Viewing 고려대학교 컴퓨터 그래픽스 연구실.
CS-378: Game Technology Lecture #2.1: Projection Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic, Jessica.
Computer Graphics Bing-Yu Chen National Taiwan University.
University of Palestine Computer Graphics ITGD3107 Prepare: Mohammed J. el-masre Nidal M. El-Borbar Supervision:
CAP4730: Computational Structures in Computer Graphics 3D Transformations.
Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.
Viewing CS418 Computer Graphics John C. Hart. Graphics Pipeline Homogeneous Divide Model Coords Model Xform World Coords Viewing Xform Still Clip Coords.
SE 313 – Computer Graphics Lecture 8: Transformations and Projections Lecturer: Gazihan Alankuş 1.
CS 325 Introduction to Computer Graphics 02 / 22 / 2010 Instructor: Michael Eckmann.
Basic 3D Concepts. Overview 1.Coordinate systems 2.Transformations 3.Projection 4.Rasterization.
Projections and Perspectives Dr Nicolas Holzschuch University of Cape Town Modified by Longin Jan Latecki.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
12-Perspective Depth Assoc.Dr. Ahmet Zafer Şenalp Mechanical Engineering Department Gebze Technical.
Graphics CSCI 343, Fall 2015 Lecture 16 Viewing I
Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Classical Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Rendering Pipeline Fall, D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.
Taxonomy of Projections FVFHP Figure Taxonomy of Projections.
Lecture 5: Introduction to 3D
A Photograph of two papers
Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab 10: 3D & Projections Advanced.
Viewing and Projection
Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.
Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.
CS552: Computer Graphics Lecture 11: Orthographic Projection.
1 PTT 105/3: Engineering Graphics. TAXONOMY OF PLANAR GEOMETRIC PROJECTIONS PTT 105/3: Engineering Graphics 2 Planar Geometric Projections Parallel Multiview.
Digital Image Processing Additional Material : Imaging Geometry 11 September 2006 Digital Image Processing Additional Material : Imaging Geometry 11 September.
CS559: Computer Graphics Lecture 9: 3D Transformation and Projection Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab 9: 3D & Projections Basics.
2D Transformation Homogenous Coordinates Scale/Rotate/Reflect/Shear: X’ = XT Translate: X’ = X + T Multiple values for the same point e.g., (2, 3, 6)
Viewing and Projection. The topics Interior parameters Projection type Field of view Clipping Frustum… Exterior parameters Camera position Camera orientation.
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.
Computer Graphics Projections.
PROJECTIONS PROJECTIONS 1. Transform 3D objects on to a 2D plane using projections 2 types of projections Perspective Parallel In parallel projection,
Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.
55:148 Digital Image Processing Chapter 11 3D Vision, Geometry
Chapter 11 Three-Dimensional Geometric and Modeling Transformations
3D Viewing cgvr.korea.ac.kr.
Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics
CENG 477 Introduction to Computer Graphics
A Photograph of two papers
Three Dimensional Viewing
Lecture 13: Cameras and geometry
Viewing (Projections)
Viewing (Projections)
THREE-DIMENSIONAL VIEWING
The Pinhole Camera Model
Projections and Perspectives
Presentation transcript:

Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab 9: 3D & Projections Basics

Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Tutorial contents Introduction to Projections Basic Concepts Projection Types and Matrix Orthographic Perspective Solve Examples

Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Introduction to Projections We live in a 3D world but the screen where the rendered objects appear is a 2D space. Thus, we need to convert somehow our 3D world to 2D. The operation which does this conversion is called projection. When Programming we focus on 2 main types of projections Orthographic – casts parallel rays of light from the scene to projection plane Perspective – casts angled rays of light from the scene to projection plane Perspective projection generates a realistic effect since our vision works the same way

Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Basic Concepts camera coordinate system viewport coordinate system device/screen coordinate system

Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Projection Type - Orthographic r 0 – a vector pointing from world origin to Projection plane origin r – object point vector (from world origin to P) P – object point P’ – projected point U – view direction Z’ – distance from P to P’ along U r’ – P’ coordinates in word CS u 1,u 2 – projected image main axis x’,y’ – P’ coordinate in image CS P P’

Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Projection Matrix - Orthographic When U is Orthogonal to u 1 and u 2 we can simplify the equations to get the matrix If U is not orthogonal (like in oblique parallel) we must use the equations given in the lecture

Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Projection Type - Perspective r v – eye coordinates Other vectors defined above

Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Projection Matrix By selecting r v =r 0 +du We can use the matrix form We can see that d causes a scaling effect

Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Solve Examples Given a cube in 3D space x = [ ]-0.5; y = [ ]-0.5; z = [ ]-0.5; We wish to find the isometric projection so we can see the cube in a 2D plane

Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Solve Examples From the lectures – Isometric projection The rotation around y axis is φ=45 The rotation around x axis is θ=35.2

Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Solve Examples Plot the 3D space for visualization %plot cube in 3D space Figureh=figure('NumberTitle','off','Name','3D space',... 'Position',[ ]); line(x,y,z); view(3); daspect([1,1,1]); set(gca,'XLabel',text('string','X'),'YLabel',text('string','Y'),'ZLabel',text('string','Z'));

Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Solve Examples Task: Define the projection matrix

Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Solve Examples Solution: Set the projection matrix MIsometric=[cosd(phi) 0 sind(phi) 0; sind(teta)*sind(phi) cosd(teta) - sind(teta)*cosd(phi) 0;... -sind(phi)*cosd(teta) sind(teta) cosd(teta)*cosd(phi) 0; ]; Task Convert to homogeneous coordinates [m,n] = size(x); x4d = [x(:),y(:),z(:),ones(m*n,1)]'; %homographic coordinates

Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Solve Examples Solution Convert to homogeneous coordinates [m,n] = size(x); x4d = [x(:),y(:),z(:),ones(m*n,1)]'; %homographic coordinates

Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Solve Examples Task Calculate the points location in 2D and plot

Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Solve Examples Solution Calculate the points location in 2D and plot %project to 2D x2d = MIsometric*x4d; x2 = zeros(m,n); y2 = zeros(m,n); x2(:) = x2d(1,:); y2(:) = x2d(2,:); Figureh=figure('NumberTitle','off','Name','2D space',... 'Position',[ ]); plot(x2,y2) set(gca,'XLim',[-1 1],'YLim',[-1 1],'XLabel',text('string','u1'),'YLabel',text('string','u2'));

Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Solve Examples Output – Question : Why is there a difference?

Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Solve Examples Answer: which view is MATLAB default? Probably not isometric

Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Notes and References This is not (!!!) the way to use projections in MATLAB This is just an illustrated example of how projections work. Mathworks Documentation Center -