University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Picking Week 10, Mon Mar.

Slides:



Advertisements
Similar presentations
Better Interactive Programs
Advertisements

CS 4731: Computer Graphics Lecture 20: Raster Graphics Part 1 Emmanuel Agu.
CS 352: Computer Graphics Chapter 7: The Rendering Pipeline.
David Luebke1/19/99 CS 551/651: Antialiasing David Luebke
CHAPTER 12 Height Maps, Hidden Surface Removal, Clipping and Level of Detail Algorithms © 2008 Cengage Learning EMEA.
CS 551 / CS 645 Antialiasing. What is a pixel? A pixel is not… –A box –A disk –A teeny tiny little light A pixel is a point –It has no dimension –It occupies.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Clipping Week 8, Wed Mar.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Advanced Rendering II,
University of British Columbia CPSC 314 Computer Graphics May-June 2005 Tamara Munzner Picking, Collision Week.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Introduction Week 1, Wed Jan 5.
Chapter 6: Vertices to Fragments Part 2 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley Mohan Sridharan Based on Slides.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Alla Sheffer Advanced Rendering Week.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Better Interactive Programs Ed Angel Professor of Computer Science, Electrical and Computer.
Projections and Picking Wed 24 Sep 2003
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Visibility II Week 7,
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Sampling Week 7, Fri 17 Oct 2003 p1 demos sampling.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Scan Conversion Week 6, Fri 10 Oct 2003 sampling.
Sampling and Aliasing Kurt Akeley CS248 Lecture 3 2 October 2007
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Picking II, Collision.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Picking and Lighting Week 4, Fri 26 Sep 2003 recap: viewports and picking.
Informationsteknologi Tuesday, November 6, 2007Computer Graphics - Class 41 Today’s class Input and interaction.
Computer Graphics Shadows
09/18/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Bump Mapping Multi-pass algorithms.
Advanced Computer Graphics CSE 190 [Spring 2015], Lecture 3 Ravi Ramamoorthi
Erdem Alpay Ala Nawaiseh. Why Shadows? Real world has shadows More control of the game’s feel  dramatic effects  spooky effects Without shadows the.
Picking. What is picking? Selecting an object on the screen What does this require? –Get Mouse Location –Compute what objects are rendered at the position.
Dr Martin Hendry, Dept of Physics and Astronomy University of Glasgow, UK Astronomical Data Analysis I 11 lectures, beginning autumn 2008.
Ray Tracing Primer Ref: SIGGRAPH HyperGraphHyperGraph.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 19 Other Graphics Considerations Review.
19/4/ :32 Graphics II Syllabus Selection and Picking Session 1.
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.
Image Synthesis Rabie A. Ramadan, PhD 3. 2 Our Problem.
CSC461 Lecture 11: Interactive Programs Contents and Objectives Picking Writing modes – XOR/Copy Rubberbanding Display list.
C O M P U T E R G R A P H I C S Guoying Zhao 1 / 14 C O M P U T E R G R A P H I C S Guoying Zhao 1 / 14 Going-through.
Korea University Korea University Computer Graphics Laboratory Computer Graphics Laboratory Jung Lee, Chapter 13.
Week 2 - Friday.  What did we talk about last time?  Graphics rendering pipeline  Geometry Stage.
Advanced Computer Graphics Depth & Stencil Buffers / Rendering to Textures CO2409 Computer Graphics Week 19.
10/26/04© University of Wisconsin, CS559 Fall 2004 Last Time Drawing lines Polygon fill rules Midterm Oct 28.
Computing & Information Sciences Kansas State University Lecture 20 of 42CIS 636/736: (Introduction to) Computer Graphics Lecture 21 of 42 William H. Hsu.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
Shadow Mapping Chun-Fa Chang National Taiwan Normal University.
1 Better Interactive Programs. 2 Objectives Learn to build more sophisticated interactive programs using ­Picking Select objects from the display Three.
Real-time Graphics for VR Chapter 23. What is it about? In this part of the course we will look at how to render images given the constrains of VR: –we.
OpenGL Selection. Three Selection Methods Color coding (OpenGL) Selection mode (OpenGL) Selection ray (generic)
Games Development 1 Camera Projection / Picking CO3301 Week 8.
1Computer Graphics Implementation II Lecture 16 John Shearer Culture Lab – space 2
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Procedural Approaches.
Implementation II Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
Implementation II.
David Luebke11/26/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
Image Synthesis Rabie A. Ramadan, PhD 4. 2 Review Questions Q1: What are the two principal tasks required to create an image of a three-dimensional scene?
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Lecture 6 Rasterisation, Antialiasing, Texture Mapping,
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Collision II, Antialiasing.
Computer Graphics I, Fall 2010 Implementation II.
Where We Stand So far we know how to: –Transform between spaces –Rasterize –Decide what’s in front Next –Deciding its intensity and color.
Shadows David Luebke University of Virginia. Shadows An important visual cue, traditionally hard to do in real-time rendering Outline: –Notation –Planar.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2010 Tamara Munzner Viewing/Projection V,
David Luebke 3/17/2016 Advanced Computer Graphics Antialiasing David Luebke
Sampling Week 7, Fri 17 Oct 2003 p1 demos sampling.
Advanced Computer Graphics
- Introduction - Graphics Pipeline
Photorealistic Rendering vs. Interactive 3D Graphics
Better Interactive Programs
The Graphics Rendering Pipeline
CS451Real-time Rendering Pipeline
Better Interactive Programs
Lecture 13 Clipping & Scan Conversion
Presentation transcript:

University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Picking Week 10, Mon Mar 14

2 News some people still haven’t demoed P2 if you don’t demo you get a 0! come see me after class sign up with ASAP

3 Project 3 proposal due 6pm Wed Mar 23 short, < 1 page of text is fine need at least 1 image annotated screenshot mockup final project due 6pm Thu Apr 7 face to face demos again I will be grading

4 Project 3 required functionality 3D, interactive, lighting/shading texturing, picking advanced functionality pieces two for 1-person team four for 2-person team six for 3-person eam

5 P3: Advanced Functionality (new) navigation procedural modelling/textures particle systems collision detection simulated dynamics level of detail control advanced rendering effects on-screen control panel (HUD) using motion capture data whatever else you want to do – check with us!

6 Review: Radiosity conserve light energy in a volume model light transport until convergence solution captures diffuse-diffuse bouncing of light view independent technique calculate solution for entire scene offline browse from any viewpoint in realtime

7 Review: Radiosity [IBM] divide surfaces into small patches loop: check for light exchange between all pairs form factor: orientation of one patch wrt other patch (n x n matrix)

8 Review: Image-Based Rendering store and access only pixels no geometry, no light simulation,... input: set of images output: image from new viewpoint surprisingly large set of possible new viewpoints

9 Review: Image As Signal 1D slice of raster image discrete sampling of 1D spatial signal theorem any signal can be represented as an (infinite) sum of sine waves at different frequencies Examples from Foley, van Dam, Feiner, and Hughes Pixel position across scanline Intensity

10 Review: Summing Waves I

11 Review: Summing Waves II represent spatial signal as sum of sine waves (varying frequency and phase shift) very commonly used to represent sound “spectrum”

12 Review: 1D Sampling and Reconstruction problems jaggies – abrupt changes lose data

13 Review: Sampling Theorem and Nyquist Rate Shannon Sampling Theorem continuous signal can be completely recovered from its samples iff sampling rate greater than twice maximum frequency present in signal sample past Nyquist Rate to avoid aliasing twice the highest frequency component in the image’s spectrum

14 Review: Aliasing incorrect appearance of high frequencies as low frequencies to avoid: antialiasing supersample sample at higher frequency low pass filtering remove high frequency function parts aka prefiltering, band-limiting

15 Correction & Review: Supersampling

16 Review: Low-Pass Filtering

17 Picking

18 Reading Red Book Selection and Feedback Chapter all Now That You Know Chapter only Object Selection Using the Back Buffer

19 Interactive Object Selection move cursor over object, click how to decide what is below? ambiguity many 3D world objects map to same 2D point four common approaches manual ray intersection bounding extents backbuffer color coding selection region with hit list

20 Manual Ray Intersection do all computation at application level map selection point to a ray intersect ray with all objects in scene. advantages no library dependence x VCS y

21 Manual Ray Intersection do all computation at application level map selection point to a ray intersect ray with all objects in scene. advantages no library dependence disadvantages difficult to program slow: work to do depends on total number and complexity of objects in scene

22 Bounding Extents keep track of axis-aligned bounding rectangles advantages conceptually simple easy to keep track of boxes in world space

23 Bounding Extents disadvantages low precision must keep track of object-rectangle relationship extensions do more sophisticated bound bookkeeping

24 Backbuffer Color Coding use backbuffer for picking create image as computational entity never displayed to user redraw all objects in backbuffer turn off shading calculations set unique color for each pickable object store in table read back pixel at cursor location check against table

25 advantages conceptually simple variable precision disadvantages number of color bits must be adequate introduce 2x redraw delay Backbuffer Color Coding

26 for(int i = 0; i < 2; i++) for(int j = 0; j < 2; j++) { glPushMatrix(); switch (i*2+j) { case 0: glColor3ub(255,0,0);break; case 1: glColor3ub(0,255,0);break; case 2: glColor3ub(0,0,255);break; case 3: glColor3ub(250,0,250);break; } glTranslatef(i*3.0,0,-j * 3.0) glCallList(snowman_display_list); glPopMatrix(); } glColor3f(1.0f, 1.0f, 1.0f); for(int i = 0; i < 2; i++) for(int j = 0; j < 2; j++) { glPushMatrix(); glTranslatef(i*3.0,0,-j * 3.0); glColor3f(1.0f, 1.0f, 1.0f); glCallList(snowman_display_list); glPopMatrix(); } Backbuffer Example

27 Select/Hit use small region around cursor for viewport assign per-object integer keys (names) redraw in special mode store hit list of objects in region examine hit list OpenGL support

28 Viewport small rectangle around cursor change coord sys so fills viewport why rectangle instead of point? people aren’t great at positioning mouse Fitts’s Law: time to acquire a target is function of the distance to and size of the target allow several pixels of slop

29 tricky to compute invert viewport matrix, set up new orthogonal projection simple utility command gluPickMatrix(x,y,w,h,viewport) x,y: cursor point w,h: sensitivity/slop (in pixels) push old setup first, so can pop it later Viewport

30 Render Modes glRenderMode(mode) GL_RENDER: normal color buffer default GL_SELECT: selection mode for picking (GL_FEEDBACK: report objects drawn)

31 Name Stack “names” are just integers glInitNames() flat list glLoadName(name) or hierarchy supported by stack glPushName(name), glPopName can have multiple names per object

32 for(int i = 0; i < 2; i++) { glPushName(i); for(int j = 0; j < 2; j++) { glPushMatrix(); glPushName(j); glTranslatef(i*10.0,0,j * 10.0); glPushName(HEAD); glCallList(snowManHeadDL); glLoadName(BODY); glCallList(snowManBodyDL); glPopName(); glPopName(); glPopMatrix(); } glPopName(); } Hierarchical Names Example

33 Hit List glSelectBuffer(buffersize, *buffer) where to store hit list data on hit, copy entire contents of name stack to output buffer. hit record number of names on stack minimum and minimum depth of object vertices depth lies in the z-buffer range [0,1] multiplied by 2^32 -1 then rounded to nearest int

34 Integrated vs. Separate Pick Function integrate: use same function to draw and pick simpler to code name stack commands ignored in render mode separate: customize functions for each potentially more efficient can avoid drawing unpickable objects

35 Select/Hit advantages faster OpenGL support means hardware accel only do clipping work, no shading or rasterization flexible precision size of region controllable flexible architecture custom code possible, e.g. guaranteed frame rate disadvantages more complex

36 Hybrid Picking select/hit approach: fast, coarse object-level granularity manual ray intersection: slow, precise exact intersection point hybrid: both speed and precision use select/hit to find object then intersect ray with that object

37 OpenGL Picking Hints gluUnproject transform window coordinates to object coordinates given current projection and modelview matrices use to create ray into scene from cursor location call gluUnProject twice with same (x,y) mouse location z = near: (x,y,0) z = far: (x,y,1) subtract near result from far result to get direction vector for ray use this ray for line/polygon intersection