Ray Tracing Geometry CSE 681.

Slides:



Advertisements
Similar presentations
Camera Calibration.
Advertisements

Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
3D Graphics Rendering and Terrain Modeling
CSE 803 Stockman Fall Stereo models Algebraic models for stereo.
Cornell CS465 Fall 2004 Lecture 3© 2004 Steve Marschner 1 Ray Tracing CS 465 Lecture 3.
Cornell CS465 Fall 2004 Lecture 3© 2004 Steve Marschner 1 Ray Tracing CS 465 Lecture 3.
Multi-view geometry. Multi-view geometry problems Structure: Given projections of the same 3D point in two or more images, compute the 3D coordinates.
Vectors and the Geometry of Space
Presentation by Dr. David Cline Oklahoma State University
CSE 681 Ray Tracing Geometry. The Camera Model Based on a simpile pin-hole camera model –Simplest lens model –Pure geometric optics – based on similar.
COMP 175: Computer Graphics March 24, 2015
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
SS5305 – Motion Capture Initialization 1. Objectives Camera Setup Data Capture using a Single Camera Data Capture using two Cameras Calibration Calibration.
Integral University EC-024 Digital Image Processing.
CS559: Computer Graphics Lecture 9: Projection Li Zhang Spring 2008.
Lecture 04 22/11/2011 Shai Avidan הבהרה : החומר המחייב הוא החומר הנלמד בכיתה ולא זה המופיע / לא מופיע במצגת.
Difference Between Raster and Vector Images Raster and vector are the two basic data structures for storing and manipulating images and graphics data on.
11.5 Day 2 Lines and Planes in Space. Equations of planes.
Chapter 2 Section 2.4 Lines and Planes in Space. x y z.
Geometric Camera Models
Vectors and the Geometry of Space 2015
: Chapter 11: Three Dimensional Image Processing 1 Montri Karnjanadecha ac.th/~montri Image.
Basic Ray Tracing CMSC 435/634.
Computer vision: models, learning and inference M Ahad Multiple Cameras
11.2 Space coordinates and vectors in Space. 3 dimensional coordinate plane.
Single-view geometry Odilon Redon, Cyclops, 1914.
Section 9.2 Vectors in 3-dim space Two approaches to vectors 1.Algebraic 2.Geometric.
Orthonormal Basis Cartesian Coordinate System – Unit vectors: i, j, k – Normalized to each other – Unique representation for each position!! – Convenient!
Ray Tracing I. Reading Hill, Chapter 14, Sections 14.1 to 14.5 Hill, Chapter 14, Sections and
Ray Tracing Part I Sources: * raytrace/rtrace0.htm * A. Watt & M. Watt. Advanced Animation & Rendering.
Geometrical Optics.
Calibrating a single camera
Reflection & Mirrors.
Introduction to Computer Graphics with WebGL
Ray Tracing Ed Angel Professor Emeritus of Computer Science
MIT EECS 6.837, Cutler and Durand
: Chapter 11: Three Dimensional Image Processing
Graphics Fundamentals
Ray Tracing Forward Ray Tracing
CSCE 441 Computer Graphics 3-D Viewing
Section 1.2 Vectors in 3-dim space
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.
VECTORS APPLICATIONS NHAA/IMK/UNIMAP.
3D Graphics Rendering PPT By Ricardo Veguilla.
Ray Tracing Geometry CSE 681.
Ray Tracing Geometry CSE 681.
Models and Architectures
Image Processing, Leture #20
Ray Tracer Project CSE 557.
Introduction to Computer Graphics with WebGL
Two-view geometry.
Ray Tracing.
Lighting.
Basic Geometric Elements
Reflection and Refraction
Orthogonal Base Cartesian Coordinate System Works in general:
Chapter 1 Section 3 Midpoint and Distance
Rendering – Basic Concepts
Models and Architectures
Circles.
Chapter 25 Reflection and Mirrors
GR2 Advanced Computer Graphics AGR
Ray Tracer Project CSE 557.
Ray Tracing Geometry CSE 681.
Reflection and Refraction
Simple Texture Mapping
Introduction to 3D Graphics
Reflection and Refraction
Introduction to Ray Tracing
Range calculations For each pixel in the left image, determine what pixel position in the right image corresponds to the same point on the object. This.
Presentation transcript:

Ray Tracing Geometry CSE 681

Camera Setup CSE 681

Camera Setup v n w u “up” vector View direction Can be formed as cross product of view vector and up vector CSE 681

Camera Setup =? Tan(q/2) = yres*pixelHeight/2N pixelHeight = 2*Tan(qy/2) *N/yres =N pixelWidth = 2*Tan(qx/2) *N/xres CSE 681

Screen Placement How do images differ if the resolution doesn’t change? CSE 681

Pixel Calculation Tan(q/2) = yres*pixelHeight/2N pixelHeight = 2*Tan(qy/2) *N/yres pixelWidth = 2*Tan(qx/2) *N/xres Pixel AspectRatio = pixelWidth/pixelHeight Coordinate (in u,v,n space) of upper left corner of screen = ? CSE 681

Pixel Calculation Coordinate (in u,v,n space) of upper left corner of screen = ? Assume virtual screen is one unit away (N=1) in w direction Eye + w - (xres/2)*PixelWidth*u + (yres/2)*PixelHeight *v CSE 681

Pixel Calculation Coordinate (in u,v,n space) of upper left pixel center = ? Eye + w - (xres/2)*PixelWidth*u + (yres/2)*PixelHeight *v + (pixelWidth/2)*u - (pixelHeight/2)*v CSE 681

Interate through pixel Centers scanlineStart = Eye + w - (xres/2)*PixelWidth*u + (yres/2)*PixelHeight *v + (pixelWidth/2)*u - (pixelHeight/2)*v pixelCenter += pixelWidth * u scanlineStart -= pixelHeight * v CSE 681

Organization of Ray Tracer For each pixel { Form ray from eye through pixel distancemin = infinity For each object { If (distance=intersect(ray,object)) { If (distance< distancemin) { closestObject = object distancemin = distance } CSE 681

Organization of Ray Tracer If (distancemin > infinityThreshold) pixelColor = background color else pixelColor = color of object at distancemin along ray d ray object eye CSE 681

Ray-Sphere Intersection - geometric Knowns C, r Eye Ray Ray t = |C-eye| d+k = (C-eye) · Ray k s t2= (d+k) 2 + s2 d r C r2 = k2+ s2 eye t CSE 681

Ray-Sphere Intersection - algebraic x2 + y2 + z2 = r2 p = eye + t*Ray Substitute definition of p into first equation: (eye.x+ t *ray.x) 2 + (eye.y+ t *ray.y)2 + (eye.z+ t *ray.z) 2 = r2 Expand squared terms and collect terms based on powers of d: A* t 2 + B* t + C = 0 CSE 681

Determine Color Use z-component of normalized normal vector FOR LAB #1 Clamp to [0.3..1.0] objectColor*Nz ray What’s the normal at a point on the sphere? eye CSE 681