Cameras Digital Image Synthesis Yung-Yu Chuang 11/01/2005 with slides by Pat Hanrahan and Matt Pharr.

Slides:



Advertisements
Similar presentations
Stupid OpenGL Shader Tricks
Advertisements

GR2 Advanced Computer Graphics AGR
Graphics Pipeline.
Projective Texture Mapping
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Projections II Week 4,
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Tamara Munzner Viewing/Projections III.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Viewing/Projections II.
Part I: Basics of Computer Graphics Viewing Transformation and Coordinate Systems Chapter
Foundations of Computer Graphics (Spring 2010) CS 184, Lecture 5: Viewing
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 Chapter 14: The Camera.
Lecture 12: Projection CS4670: Computer Vision Noah Snavely “The School of Athens,” Raphael.
The Pinhole Camera Model
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Tamara Munzner Viewing/Projections I.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Models and Architectures Ed Angel Professor of Computer Science, Electrical and Computer.
Projection Projection - the transformation of points from a coordinate system in n dimensions to a coordinate system in m dimensions where m
3D Rendering with JOGL Introduction to Java OpenGL Graphic Library By Ricardo Veguilla
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.
01/28/05© 2005 University of Wisconsin Last Time Improving Monte Carlo Efficiency.
Geometry and Transformations Digital Image Synthesis Yung-Yu Chuang 9/28/2006 with slides by Pat Hanrahan.
MIT EECS 6.837, Durand and Cutler Graphics Pipeline: Projective Transformations.
2 COEN Computer Graphics I Evening’s Goals n Discuss the mathematical transformations that are utilized for computer graphics projection viewing.
CS559: Computer Graphics Lecture 9: Projection Li Zhang Spring 2008.
Graphics Graphics Korea University cgvr.korea.ac.kr 3D Viewing 고려대학교 컴퓨터 그래픽스 연구실.
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
Real-Time Rendering Digital Image Synthesis Yung-Yu Chuang 01/03/2006 with slides by Ravi Ramamoorthi and Robin Green.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Film Digital Image Synthesis Yung-Yu Chuang 11/5/2008 with slides by Pat Hanrahan and Matt Pharr.
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.
CAP4730: Computational Structures in Computer Graphics 3D Transformations.
CS348B Lecture 7Pat Hanrahan, 2005 Camera Simulation EffectCause Field of viewFilm size, stops and pupils Depth of field Aperture, focal length Motion.
CS559: Computer Graphics Lecture 9: Rasterization Li Zhang Spring 2008.
CS 450: COMPUTER GRAPHICS PROJECTIONS SPRING 2015 DR. MICHAEL J. REALE.
Cameras Digital Image Synthesis Yung-Yu Chuang 10/26/2006 with slides by Pat Hanrahan and Matt Pharr.
CSE 681 DISTRIBUTED RAY TRACING some implementation notes.
1 Chapter 2: Geometric Camera Models Objective: Formulate the geometrical relationships between image and scene measurements Scene: a 3-D function, g(x,y,z)
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.
Chapters 5 2 March Classical & Computer Viewing Same elements –objects –viewer –projectors –projection plane.
Foundations of Computer Graphics (Spring 2012) CS 184, Lecture 5: Viewing
Geometric Objects and Transformations. Graphics Pipeline How can we render a triangle? High-level description: – Represent the 3D geometry – Transform.
1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis.
Cameras Digital Image Synthesis Yung-Yu Chuang with slides by Pat Hanrahan and Matt Pharr.
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.
Viewing and Projection. The topics Interior parameters Projection type Field of view Clipping Frustum… Exterior parameters Camera position Camera orientation.
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.
Viewing. Classical Viewing Viewing requires three basic elements - One or more objects - A viewer with a projection surface - Projectors that go from.
Outline 3D Viewing Required readings: HB 10-1 to 10-10
Rendering Pipeline Fall, 2015.
Digital Image Synthesis Yung-Yu Chuang 10/25/2007
Digital Image Synthesis Yung-Yu Chuang 10/15/2008
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016
CSE 167 [Win 17], Lecture 5: Viewing Ravi Ramamoorthi
3D Viewing cgvr.korea.ac.kr.
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.
Models and Architectures
Viewing/Projections I Week 3, Fri Jan 25
Models and Architectures
Models and Architectures
Introduction to Computer Graphics with WebGL
Study the mathematical relations between corresponding image points.
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University View & Projection.
Digital Image Synthesis Yung-Yu Chuang 11/01/2005
Models and Architectures
Models and Architectures
Digital Image Synthesis Yung-Yu Chuang 11/8/2007
Presentation transcript:

Cameras Digital Image Synthesis Yung-Yu Chuang 11/01/2005 with slides by Pat Hanrahan and Matt Pharr

Camera class Camera { public: virtual float GenerateRay(const Sample &sample, Ray *ray) const = 0;... Film *film; protected: Transform WorldToCamera, CameraToWorld; float ClipHither, ClipYon; float ShutterOpen, ShutterClose; }; sample position at the image plane corresponding normalized ray in the world space return a weight, useful for simulating real lens z hitheryon for simulating motion blur, not Implemented yet

Camera space

Coordinate spaces world space object space camera space (origin: camera position, z: viewing direction, y: up direction) screen space: a 3D space defined on the image plane, z ranges from 0(near) to 1(far) normalized device space (NDC): (x, y) ranges from (0,0) to (1,1) for the rendered image, z is the same as the screen space raster space: similar to NDC, but the range of (x,y) is from (0,0) to (xRes, yRes)

Screen space screen space screen window raster space infinite image plane NDC

Projective camera models Transform a 3D scene coordinate to a 2D image coordinate by a 4x4 projective matrix class ProjectiveCamera : public Camera { public: ProjectiveCamera(Transform &world2cam, Transform &proj, float Screen[4], float hither, float yon, float sopen, float sclose, float lensr, float focald, Film *film); protected: Transform CameraToScreen, WorldToScreen, RasterToCamera; Transform ScreenToRaster, RasterToScreen; float LensRadius, FocalDistance; }; camera to screen projection

Projective camera models ProjectiveCamera::ProjectiveCamera(...) :Camera(w2c, hither, yon, sopen, sclose, f) {... CameraToScreen=proj; WorldToScreen=CameraToScreen*WorldToCamera; ScreenToRaster = Scale(float(film->xResolution), float(film->yResolution), 1.f)* Scale(1.f / (Screen[1] - Screen[0]), 1.f / (Screen[2] - Screen[3]), 1.f)* Translate(Vector(-Screen[0],-Screen[3],0.f)); RasterToScreen = ScreenToRaster.GetInverse(); RasterToCamera = CameraToScreen.GetInverse() * RasterToScreen; }

Projective camera models orthographicperspective

Orthographic camera Transform Orthographic(float znear, float zfar) { return Scale(1.f, 1.f, 1.f/(zfar-znear)) *Translate(Vector(0.f, 0.f, -znear)); }

OrthoCamera::GenerateRay float OrthoCamera::GenerateRay (const Sample &sample, Ray *ray) const { Point Pras(sample.imageX,sample.imageY,0); Point Pcamera; RasterToCamera(Pras, &Pcamera); ray->o = Pcamera; ray->d = Vector(0,0,1); ray->mint = 0.; ray->maxt = ClipYon - ClipHither; ray->d = Normalize(ray->d); CameraToWorld(*ray, ray); return 1.f; }

Perspective camera

Transform Perspective(float fov,float n,float f) { float inv_denom = 1.f/(f-n); Matrix4x4 *persp = new Matrix4x4 (1, 0, 0, 0, 0, 1, 0, 0, 0, 0, f*inv_denom, -f*n*inv_denom, 0, 0, 1, 0 ); float invTanAng= 1.f / tanf(Radians(fov)/2.f); return Scale(invTanAng, invTanAng, 1) * Transform(persp); }

PerspectiveCamera::GenerateRay float PerspectiveCamera::GenerateRay (const Sample &sample, Ray *ray) const { // Generate raster and camera samples Point Pras(sample.imageX, sample.imageY, 0); Point Pcamera; RasterToCamera(Pras, &Pcamera); ray->o = Pcamera; ray->d = Vector(Pcamera.x,Pcamera.y,Pcamera.z); ray->d = Normalize(ray->d); ray->mint = 0.; ray->maxt = (ClipYon-ClipHither)/ray->d.z; CameraToWorld(*ray, ray); return 1.f; }

Environment camera

x=sinθcosψ y=sinθsinψ z=cosθ

EnvironmentCamera::GenerateRay float EnvironmentCamera::GenerateRay (const Sample &sample, Ray *ray) const { ray->o = rayOrigin; float theta=M_PI*sample.imageY/film->yResolution; float phi=2*M_PI*sample.imageX/film->xResolution; Vector dir(sinf(theta)*cosf(phi), cosf(theta), sinf(theta)*sinf(phi)); CameraToWorld(dir, &ray->d); ray->mint = ClipHither; ray->maxt = ClipYon; return 1.f; }