Projection & Interaction

Similar documents
CENG 477 Introduction to Computer Graphics. Modeling Transformations

Gauss-Jordan Algorithm

4.1 3D GEOMETRIC TRANSFORMATIONS

STEREO PLANE MATCHING TECHNIQUE

M y. Image Warping. Targil 7 : Image Warping. Image Warping. 2D Geometric Transformations. image filtering: change range of image g(x) = T(f(x))

NEWTON S SECOND LAW OF MOTION

EECS 487: Interactive Computer Graphics

CAMERA CALIBRATION BY REGISTRATION STEREO RECONSTRUCTION TO 3D MODEL

STRING DESCRIPTIONS OF DATA FOR DISPLAY*

AML710 CAD LECTURE 11 SPACE CURVES. Space Curves Intrinsic properties Synthetic curves

Announcements For The Logic of Boolean Connectives Truth Tables, Tautologies & Logical Truths. Outline. Introduction Truth Functions

Implementing Ray Casting in Tetrahedral Meshes with Programmable Graphics Hardware (Technical Report)

Projective geometry- 2D

MOTION DETECTORS GRAPH MATCHING LAB PRE-LAB QUESTIONS

geometric transformations

Image warping Li Zhang CS559

Systems & Biomedical Engineering Department. Transformation

A METHOD OF MODELING DEFORMATION OF AN OBJECT EMPLOYING SURROUNDING VIDEO CAMERAS

Digital Geometry Processing Differential Geometry

CS 428: Fall Introduction to. Geometric Transformations (continued) Andrew Nealen, Rutgers, /20/2010 1

In Proceedings of CVPR '96. Structure and Motion of Curved 3D Objects from. using these methods [12].

Image warping/morphing

Effects needed for Realism. Ray Tracing. Ray Tracing: History. Outline. Foundations of Computer Graphics (Fall 2012)

Ray Casting. Outline. Outline in Code

4. Minimax and planning problems

Geometry Transformation

Virtual Recovery of Excavated Archaeological Finds

Overview. 9 - Game World: textures, skyboxes, etc. Texture Mapping. Texture Space. Vertex Texture Coordinates. Texture Mapping. Game World Backgrounds

Last Time: Curves & Surfaces. Today. Questions? Limitations of Polygonal Meshes. Can We Disguise the Facets?

3-D Object Modeling and Recognition for Telerobotic Manipulation

A Matching Algorithm for Content-Based Image Retrieval

Real-Time Avatar Animation Steered by Live Body Motion

Quantitative macro models feature an infinite number of periods A more realistic (?) view of time

Motion Estimation of a Moving Range Sensor by Image Sequences and Distorted Range Data

Wiley Plus. Assignment 1 is online:

Sam knows that his MP3 player has 40% of its battery life left and that the battery charges by an additional 12 percentage points every 15 minutes.

Upper Body Tracking for Human-Machine Interaction with a Moving Camera

Research Article Auto Coloring with Enhanced Character Registration

MARSS Reference Sheet

Shortest Path Algorithms. Lecture I: Shortest Path Algorithms. Example. Graphs and Matrices. Setting: Dr Kieran T. Herley.

Video Content Description Using Fuzzy Spatio-Temporal Relations

Motion Level-of-Detail: A Simplification Method on Crowd Scene

MATH Differential Equations September 15, 2008 Project 1, Fall 2008 Due: September 24, 2008

Fill in the following table for the functions shown below.

Introduction to Data-Driven Animation: Programming with Motion Capture Jehee Lee

Proceeding of the 6 th International Symposium on Artificial Intelligence and Robotics & Automation in Space: i-sairas 2001, Canadian Space Agency,

Coded Caching with Multiple File Requests

Spline Curves. Color Interpolation. Normal Interpolation. Last Time? Today. glshademodel (GL_SMOOTH); Adjacency Data Structures. Mesh Simplification

Traditional Rendering (Ray Tracing and Radiosity)

Optics and Light. Presentation

Improved TLD Algorithm for Face Tracking

Curves & Surfaces. Last Time? Today. Readings for Today (pick one) Limitations of Polygonal Meshes. Today. Adjacency Data Structures

1.4 Application Separable Equations and the Logistic Equation

A NEW APPROACH FOR 3D MODELS TRANSMISSION

LAMP: 3D Layered, Adaptive-resolution and Multiperspective Panorama - a New Scene Representation

arxiv: v1 [cs.cv] 25 Apr 2017

Rao-Blackwellized Particle Filtering for Probing-Based 6-DOF Localization in Robotic Assembly

Optimal Crane Scheduling

Engineering Mathematics 2018

X-Splines : A Spline Model Designed for the End-User

Schedule. Curves & Surfaces. Questions? Last Time: Today. Limitations of Polygonal Meshes. Acceleration Data Structures.

Design Alternatives for a Thin Lens Spatial Integrator Array

Rendering Pipeline/ OpenGL

Section 2. Mirrors and Prism Systems

REDUCTIONS BBM ALGORITHMS DEPT. OF COMPUTER ENGINEERING ERKUT ERDEM. Bird s-eye view. May. 12, Reduction.

Chapter 4 Sequential Instructions

Image segmentation. Motivation. Objective. Definitions. A classification of segmentation techniques. Assumptions for thresholding

Ray Tracing II. Improving Raytracing Speed. Improving Computational Complexity. Raytracing Computational Complexity

Data Structures and Algorithms. The material for this lecture is drawn, in part, from The Practice of Programming (Kernighan & Pike) Chapter 2

MORPHOLOGICAL SEGMENTATION OF IMAGE SEQUENCES

Chapter Six Chapter Six

Today. Curves & Surfaces. Can We Disguise the Facets? Limitations of Polygonal Meshes. Better, but not always good enough

Reconstruct scene geometry from two or more calibrated images. scene point. image plane. Reconstruct scene geometry from two or more calibrated images

Midterm Exam Announcements

Viewing Transformation

ME 406 Assignment #1 Solutions

Real time 3D face and facial feature tracking

CS380: Computer Graphics Viewing Transformation. Sung-Eui Yoon ( 윤성의 ) Course URL:

the marginal product. Using the rule for differentiating a power function,

Image Based Computer-Aided Manufacturing Technology

Occlusion-Free Hand Motion Tracking by Multiple Cameras and Particle Filtering with Prediction

Scattering at an Interface: Normal Incidence

Visual Perception as Bayesian Inference. David J Fleet. University of Toronto

Streamline Pathline Eulerian Lagrangian

Image Content Representation

Computer representations of piecewise

UX260 QUICK START GUIDE

THERMAL PHYSICS COMPUTER LAB #3 : Stability of Dry Air and Brunt-Vaisala Oscillations

Numerical Solution of ODE

Jorge Salvador Marques, Stereo Reconstruction

Why not experiment with the system itself? Ways to study a system System. Application areas. Different kinds of systems

The Roots of Lisp paul graham

Video-Based Face Recognition Using Probabilistic Appearance Manifolds

Low-Cost WLAN based. Dr. Christian Hoene. Computer Science Department, University of Tübingen, Germany

Evaluation and Improvement of Region-based Motion Segmentation

V103 TRIPLE 10-BIT LVDS TRANSMITTER FOR VIDEO. General Description. Features. Block Diagram

A Principled Approach to. MILP Modeling. Columbia University, August Carnegie Mellon University. Workshop on MIP. John Hooker.

Experiments in Generalizing Geometry Theorems Stephen B. Gray

IDEF3 Process Description Capture Method

Learning in Games via Opponent Strategy Estimation and Policy Search

Transcription:

Projecion & Ineracion Algebra of projecion Canonical viewing volume rackball inerface ransform Hierarchies Preview of Assignmen #2 Lecure 8 Comp 236 Spring 25 Projecions Our lives are grealy simplified by he fac ha viewing ransformaions ransform he eye o he origin and he look-a direcion (opical axis) o a specified coordinae axis. his reduces he range of projecion marices. A projecion maps all 3-D coordinaes ono a desired viewing plane. hus, making our 3-D ino a 2-D image. his sor of mapping is no affine like all of he ransforms we ve discussed hus far. In fac, projecion marices do no ransform poins from our affine space back ino he same space. hey ransform poins ino somehing differen. Usually, we will use a projecion marix o reduce he dimensionally of our affine poins. hus, we should expec projecion marices o be less han full rank. 2/4/25 Lecure 9 2 Orhographic Projecion he simples form of projecion, is o simply projec all poins along lines parallel o he z-axis. his form of projecion is called orhographic or parallel. I is he ommon form of projecion used by drafs people for op, boom, and side views. he advanage of parallel projecion is ha he you can make accurae easuremens of image feaures in he wo dimensions ha remain. he isadvanage is ha he images don appear naural (i.e. hey lack perspecive oreshorening). ere is an example of an parallel rojecion of our scene. oice ha he parallel lines of he iled floor remain parallel fer orhographic projecion. Orhographic Projecion he projecion marix for orhographic projecion is very simple x y z x y z here are some problems wih his simple form, however. o begin wih he unis of he ransformed poins are sill he same as he model. his is grea for drafing, bu in our case we d like o unis ha are model-independen. his will allow us o perform a wide range of operaions using normalized coordinaes.

Normalized Device Coordinaes herefore we will compose our projecion wih a se of scale and a ranslaion ha maps our coordinaes in unis o normalized device coordinaes. Orhographic Projecions o NDC Here is he mapping: x y z righ 2 lef Some saniy checks: x lef x op boom 2 far 2 (righ lef ) righ lef (op boom) op boom (far ) far righ lef righ lef righ 2 lef lef righ lef righ lef x y z We also scale he z coordinae in exacly he same way (i.e. all z values beween and far are mapped from o respecively). echnically, his coordinae is no par of he projecion. Bu, we will use his value of z for oher purposes. x righ x 2 righ lef righ lef righ righ lef righ lef righ lef 2/4/25 Lecure 9 5 2/4/25 Lecure 9 6 Orhographic Projecion in OpenGL his marix is consruced by he following OpenGL call: void glorho(double lef, double righ, double boom, double op, double, double far ); And he 2-D version (anoher GL uiliy funcion): Perspecive Projecion Ariss (Donaello, Brunelleschi, Durer, and Da Vinci) during he renaissance discovered he imporance of perspecive for making images appear realisic. his oudaes mahemaicians by more han 3 years. Perspecive causes objecs er o he viewer o appear larger han he same objec would appear farher away. Anoher for inroducing homogenous coordinaes o compuer graphics was o accomplish perspecive projecions using li operaors. void gluorho2d( double lef, GLdouble righ, double boom, GLdouble op); Which is jus a call o glorho( ) wih - and far ;

Signs of Perspecive Noice how lines known o be parallel in image space appear o converge o a single poin when viewed in perspecive. his is an imporan aribue of lines in projecive spaces, hey always inersec a a poin. Perspecive Projecion he simples ransform for perspecive projecion is: wx wy w x y z We hen apply our rules for a projecive spaces, o find our preferred poin (he one wih a fourh componen of ) by dividing each elemen of he vecor by w. In his example projecion marix, w is simply he z componen. 2/4/25 Lecure 9 9 2/4/25 Lecure 9 Normalized Perspecive As in he orhographic case, perspecive projecion preserves he unis of -space. Once again, o simplify laer operaions we would like o specify a perspecive projecion where some specific range of -space coordinaes are mapped o a Normalized coordinae sysem. NDC Perspecive Marix his can be accomplished wih a clever composiion of ransforms wih our projecion marix. wx wy wz w righ 2 lef (righ lef ) righ lef (op boom) op 2 boom op boom far far 2 far far x y z he values of lef, righ, op, and boom are specified a he deph. Le s ry some saniy checks: (righ lef ) x lef 2 righ lef lef righ lef x z x righ x z 2 righ (righ lef ) righ lef righ lef

NDC Perspecive Marix his can be accomplished wih a clever composiion of ransforms wih our projecion marix. wx wy wz w righ 2 lef (righ lef ) righ lef (op boom) op 2 boom op boom far far 2 far far x y z he values of lef, righ, op, and boom are specified a he deph. Le s ry some saniy checks: 2 far far far far z far z far far ( far ) far far far z z far 2 far far ( far ) far far 2/4/25 Lecure 9 3 Perspecive in OpenGL OpenGL provides he following funcion o define perspecive ransformaions: void glfrusum(double lef, double righ, double boom, double op, double, double far); Some hink ha using glfrusum( ) is noninuiive. So OpenGL provides a uiliy funcion wih simpler, bu less general capabiliies. void gluperspecive(double verfov, double aspec, double, double far); 2/4/25 Lecure 9 4 gluperspecive() he following figure illusraes he parameers of gluperspecive(): Subsiuing he exens ino glfrusum() Simple camera-like model Can only specify symmeric frusums. Skewed Frusums here are many cases when a skewed frusum is he only way o ge he job done Sereo viewing on a single muliplexed display (non HMD) racked viewer (even for mono viewing) Fixed viewpor moving viewer lef righ far wx wy wz w verfov CO( ) 2 aspec CO( verfov 2 ) far far 2 far far x y z

Exercise: A rackball Inerface A common UI for manipulaing objecs Virual rackball 2 degree of freedom device However, is differenial behavior provides a inuiive roaion specificaion A Virual rackball Imagine he viewpor as floaing above, and jus ouching an acual rackball. You receive he coordinaes in screen space of he MouseDown() and MouseMove() evens. Wha is he axis of roaion? Wha is he angle of roaion? 2/4/25 Lecure 9 7 2/4/25 Lecure 9 8 Compuing he Roaion Consruc a vecor a v from he cener of roaion of he virual rackball o he poin of he MouseDown() even. Consruc a 2 nd vecor b v from he cener of roaion for a given MouseMove() even. Normalize â a v v a, and bˆ b v v, and hen compue axis â bˆ b hen find he angle Arc sin( â bˆ ) and consruc axis R Roae(angle, ) axis a v b v axis Where o Roae? Where do you inser i in rendering process so as o have he desired inerface? c& w& w& camera mod el ( ) w& c & camera 4243 V c& c& V V R mod el p& mod el p& mod el c& VR p& 23 mod el

he Proof is in he Code And he Display Rouine def onmousebuon(buon, sae, x, y): global oldx, oldy if (sae GLU_DOWN): oldx, oldy x, y def onmousedrag(x, y): global oldx, oldy, deph if (mode r ): v Vecor(oldX -.5*widh,.5*heigh - oldy,.5*widh).normalize() v Vecor(x -.5*widh,.5*heigh - y,.5*widh).normalize() axis v.cross(v) angle mah.asin(axis.lengh()) axis axis.normalize() glpushmarix() glloadideniy() glroaed(angle*8/mah.pi, axis.x, axis.y, axis.z) glmulmarixd(obj2wld.marix()) obj2wld.se(glgefloav(gl_modelview_marix)) glpopmarix() oldx, oldy x, y def display(): glclear(gl_color_buffer_bi GL_DEPH_BUFFER_BI) glpushmarix() glulooka(,,24,,,,,,) glpushmarix() glmulmarixd(obj2wld.marix()) drawframe(5) obj.draw() glpopmarix() drawbackdrop() glflush() glpopmarix() gluswapbuffers() Wha would happen if I ook ou hese pushes and pops? 2/4/25 Lecure 9 2 2/4/25 Lecure 9 22 ransformaion Hierarchies Many models are composed of independen moving pars Each par defined in i s own coordinae sysem Compose ransforms o posiion and orien he model pars A Simple One-chain Example Using Graphs o Model Hierarchies Model pars are nodes ransforms are edges Wha ransform is applied o he Head par o ge i ino coordinaes? 4 w& head Suppose ha you d like o roae he Neck join a he poin where i mees he Body. hen wha is he Head s ransform o space? 3 2 R head w& R 4 Base Body Neck Head w& 2 3 2 4 3 head

Code Example ( s ry) Code Example (2 nd ry) public override void Draw() { glclear(gl_color_buffer_bi GL_DEPH_BUFFER_BI); glloadideniy(); glulooka(,,-6,,,,,,); // -o-camera ransform glcolor3d(,,); glroaed(-9,,, ); // -o- ransform mom.draw(lamp.base); mom.draw(lamp.body); mom.draw(lamp.neck); mom.draw(lamp.head); glflush(); } public override void Draw() { glclear(gl_color_buffer_bi GL_DEPH_BUFFER_BI); glloadideniy(); glranslaed(.,., -6.); // -o-view ransform glcolor3d(,,); glroaed(-9,,, ); // -o- ransform mom.draw(lamp.base); glranslaed(,,2.5); // -o- ransform mom.draw(lamp.body); glranslaed(2,,); // -o- ransform mom.draw(lamp.neck); glranslaed(2,,); // head-o- ransform mom.draw(lamp.head); glflush(); } 2/4/25 Lecure 9 25 2/4/25 Lecure 9 26 Code Example (3 rd ry) Demo public override void Draw() { glclear(gl_color_buffer_bi GL_DEPH_BUFFER_BI); glloadideniy(); glranslaed(., -2., -6.); // -o-view ransform glcolor3d(,,); glroaed(-9,,, ); // -o- ransform mom.draw(lamp.base); glranslaed(,,2.5); // -o- ransform glroaed(-3,,, ); // roae a pivo mom.draw(lamp.body); glranslaed(2,,); // -o- ransform glroaed(-5,,, ); // roae a pivo mom.draw(lamp.neck); glranslaed(2,,); // head-o- ransform glroaed(8,,, ); // roae head a pivo mom.draw(lamp.head); glflush(); }

Skeleon Code: Your Nex Projec Kinemaics Kinemaics describes he moions of bodies (pars) wihou considering he forces required o produce and mainain he moion. More abou geomeric CONSRAINS han PHYSICS. An ariculaed model wih pars, bu only 6 Models Here s where glpushmarix() and glpopmarix() earn heir keep Rs Rf head runk R L Ls Lf Head runk Rc Lc Rs Ls Rf R L Lf Rc Lc 2/4/25 Lecure 9 29 2/4/25 Lecure 9 3 Nex ime As well as Picking & Selecion