Controlling a Virtual Camera Ross Ptacek University of Alabama Birmingham.

Slides:



Advertisements
Similar presentations
Computer Graphics - Rasterization -
Advertisements

Visible-Surface Detection(identification)
Christian Lauterbach COMP 770, 2/16/2009. Overview  Acceleration structures  Spatial hierarchies  Object hierarchies  Interactive Ray Tracing techniques.
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Chapter 4.2 Collision Detection and Resolution. 2 Collision Detection Complicated for two reasons 1. Geometry is typically very complex, potentially requiring.
Computer Graphics Viewing.
© University of Wisconsin, CS559 Spring 2004
1 Curves and Surfaces. 2 Representation of Curves & Surfaces Polygon Meshes Parametric Cubic Curves Parametric Bi-Cubic Surfaces Quadric Surfaces Specialized.
Week 14 - Monday.  What did we talk about last time?  Bounding volume/bounding volume intersections.
Graphics Graphics Korea University cgvr.korea.ac.kr 3D Object Representation 고려대학교 컴퓨터 그래픽스 연구실.
Chapter 6: Vertices to Fragments Part 2 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley Mohan Sridharan Based on Slides.
Vertices and Fragments I CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
GATE D Object Representations (GATE-540) Dr.Çağatay ÜNDEĞER Instructor Middle East Technical University, GameTechnologies & General Manager SimBT.
1cs533d-winter-2005 Notes  More optional reading on web for collision detection.
Chapter 4.2 Collision Detection and Resolution. 2 Collision Detection Complicated for two reasons 1. Geometry is typically very complex, potentially requiring.
Modelling. Outline  Modelling methods  Editing models – adding detail  Polygonal models  Representing curves  Patched surfaces.
1 Geometry A line in 3D space is represented by  S is a point on the line, and V is the direction along which the line runs  Any point P on the line.
OBBTree: A Hierarchical Structure for Rapid Interference Detection Gottschalk, M. C. Lin and D. ManochaM. C. LinD. Manocha Department of Computer Science,
1cs533d-term Notes  list Even if you’re just auditing!
Part I: Basics of Computer Graphics Rendering Polygonal Objects (Read Chapter 1 of Advanced Animation and Rendering Techniques) Chapter
Introduction to 3D Graphics John E. Laird. Basic Issues u Given a internal model of a 3D world, with textures and light sources how do you project it.
Modeling and representation 1 – comparative review and polygon mesh models 2.1 Introduction 2.2 Polygonal representation of three-dimensional objects 2.3.
Curves and Surfaces (cont’) Amy Zhang. Conversion between Representations  Example: Convert a curve from a cubic B-spline curve to the Bézier form:
11/19/02 (c) 2002, University of Wisconsin, CS 559 Last Time Many, many modeling techniques –Polygon meshes –Parametric instancing –Hierarchical modeling.
Introduction Tracking the corners Camera model and collision detection Keyframes Path Correction Controlling the entire path of a virtual camera In computer.
4/15/04© University of Wisconsin, CS559 Spring 2004 Last Time More modeling: –Hierarchical modeling –Instancing and Parametric Instancing –Constructive.
1 Speeding Up Ray Tracing Images from Virtual Light Field Project ©Slides Anthony Steed 1999 & Mel Slater 2004.
2D/3D Shape Manipulation, 3D Printing Shape Representations Slides from Olga Sorkine February 20, 2013 CS 6501.
Visible-Surface Detection Jehee Lee Seoul National University.
12/4/2001CS 638, Fall 2001 Today Managing large numbers of objects Some special cases.
Copyright © Curt Hill Visualization of 3D Worlds How are these images described?
1 CS 430/536 Computer Graphics I Curve Drawing Algorithms Week 4, Lecture 8 David Breen, William Regli and Maxim Peysakhov Geometric and Intelligent Computing.
1Computer Graphics Implementation II Lecture 16 John Shearer Culture Lab – space 2
Implementation II Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Parametric Surfaces Define points on the surface in terms of two parameters Simplest case: bilinear interpolation s t s x(s,t)x(s,t) P 0,0 P 1,0 P 1,1.
3D Object Representations
Implementation II.
Computer Graphics Zhen Jiang West Chester University.
Basic Perspective Projection Watt Section 5.2, some typos Define a focal distance, d, and shift the origin to be at that distance (note d is negative)
Course 8 Contours. Def: edge list ---- ordered set of edge point or fragments. Def: contour ---- an edge list or expression that is used to represent.
1 Subdivision. 2 Subdivision for game Why? Large model require many memory for storage Need to dynamically tessellated during game play Make surface modeling.
04/18/02(c) 2002 University of Wisconsin Last Time Hermite Curves Bezier Curves.
Ray Tracing II. HW1 Part A due October 10 Camera module Object module –Read from a file –Sphere and Light only Ray tracer module: –No shading. No reflection.
11/26/02(C) University of Wisconsin Last Time BSplines.
3D Object Representations 2011, Fall. Introduction What is CG?  Imaging : Representing 2D images  Modeling : Representing 3D objects  Rendering : Constructing.
Computer Graphics I, Fall 2010 Implementation II.
CS 450: Computer Graphics PARAMETRIC SPLINES AND SURFACES
1 CSCE 441: Computer Graphics Hidden Surface Removal Jinxiang Chai.
CS 318 Intro to Computer Graphics John C. Hart
01/28/09Dinesh Manocha, COMP770 Visibility Computations Visible Surface Determination Visibility Culling.
Slide 1Lecture Fall ‘00 Surface Modeling Types: Polygon surfaces Curved surfaces Volumes Generating models: Interactive Procedural.
3D Object Representations 2009, Fall. Introduction What is CG?  Imaging : Representing 2D images  Modeling : Representing 3D objects  Rendering : Constructing.
CS552: Computer Graphics Lecture 28: Solid Modeling.

Rendering Pipeline Fall, 2015.
© University of Wisconsin, CS559 Spring 2004
Computer Graphics Implementation II
Distance Computation “Efficient Distance Computation Between Non-Convex Objects” Sean Quinlan Stanford, 1994 Presentation by Julie Letchner.
Modeliranje kompleksnih modelov
3D Object Representations
3D Object Representation
© University of Wisconsin, CS559 Fall 2004
Chapter 4.2 Collision Detection and Resolution
Implementation II Ed Angel Professor Emeritus of Computer Science
Three-Dimensional Object Representation
Introduction to Computer Graphics with WebGL
3D Object Representation
Overview of Modeling 김성남.
Modeliranje kompleksnih modelov
Implementation II Ed Angel Professor Emeritus of Computer Science
Presentation transcript:

Controlling a Virtual Camera Ross Ptacek University of Alabama Birmingham

A Sample Flythrough

The Problems Precompute a path through a scene How to represent the path and scene? How to detect problems (collisions)? How to correct the path?

Path and Scene Representation Path  Keyframes  Position and Orientation  Bezier for position (B(t))  Quaternion for orientation (Q(t)) Numerical stability Robustness Scene  Polygonal Mesh  Triangulated (T s ) Easier to deal with Octree data structure

Camera Model The path of the camera is insufficient Rectangular Frustum view Volume Near Clipping Plane (NCP) is important Collisions intersect NCP

Computing NCP Frustum Parameters  Fovy, aspect ratio, near, far (gluPerspective) X = near * tan (fovy / 2) Aspect = fovy / fovx Y = near * tan (fovx /2 ) Can calculate all corners this way Or set with glFrustum

What Makes a Collision? Intersection with NCP NCP sweeps out a volume as the camera moves (position = B(t), ori = Q(t)) Any scene geometry that intersects this volume means collision Need to determine what triangles are inside the volume

Finding the Swept Volume Given B(t) and Q(t), find a curve for each corner of NCP, C 0 (s)…C 3 (s) Johnstone and Williams ’95  Quat. Spline -> Rotmat Spline  Rotmat * (Corner Point) -> oriented corner point Triangulate between C i (s) and C (i+1)%4 (s)

Finding Collisions Two Types of Collisions  Penetrate the sides of the volume  Fully enclosed by the volume

Type 1 Collisions Triangulate between corner curves to find the outer surface of the volume (T p ) Sampling  Constant interval (easy but may lose info)  Curvature Based (harder, more accurate) Intersect T p with T s to find collisions

Type 2 Collisions Compute NCP at some sampling density  Similar sampling issues as before Triangulate each NCP and intersect with T s Add these triangles to T p

Path correction In general, find problem areas and push the path away from them by adding new keyframes Identify parameter intervals w/ collisions Find “depth” of intersection Insert new keyframe in middle of interval pushed away from the collision

Octree Too many intersection operations Spatial Decomposition to speed up intersections Recursively decompose space into octants  On subdivision, send triangles to the proper octants  If a triangle straddles 2+ octants, data duplication Key idea for intersection: Can limit the number of scene triangles in each octant. Subdivide when n triangles have been inserted Careful choice of n as duplication diminishes speed ups

Find Parameter Interval Assign parameter value to each element of T p Sort T p by parameter value & intersect in sorted order When an intersection is found, record the parameter value (s 1 ) and the value of the previous triangle(s 0 ) Use binary search between s 1 and s 0 to find the exact parameter where the first intersection occurs (s i ). Continue inserting triangles until there is no intersection. Record the parameter value (s 3 ) and the previous (s 2 ) and use binary search between them to find s f.

Determining the New Keyframe Need both Position and Orientation Orientation first  Find s mid = (s f – s i )/2  s is not in same parameter as B(t)!  Same number of knots  Use linear interpolation to find a parameter, t mid for B(t) and Q(t) Use Q(t mid ) for the orientation

New Position Start with B(t mid ) and move away from where the intersections are Compute NCP at s=s mid Intersect line segments from the middle of the NCP to each corner  If there is an intersection, consider that corner “bad”, otherwise consider it “good” Intersect the four edges of the NCP with T s and record parameter values along the edges where intersections occur

New Position (cont.) For each “bad” corner, find the intersections closest to it on each connected edge. Choose the max of these as the corner depth Take the max corner depth of all bad corners as the overall depth, d

New Position (cont.) Take vectors from the center to each “good” corner Average these vectors and normalize the result (V) Scale this vector (V) by f New position = B(t mid ) + d*V Repeat until the NCP is not intersecting Continue insersecting triangles ordered by parameter value but start with s i (rescan interval)

Results Black curves: original corner curves Green curves: corrected corner curves Black box: NCP at endpoints of intersection interval Red line: B(t)

More Results

Conclusion Smooth natural path Avoids collisions Fairly fast. Worse intersections mean more computation needed to correct

Future Work BSP tree rather than Octree Different measure of intersection depths Orientation constraints Some key frame configurations make collision avoidance impossible

Thanks UAB Department of Computer Science Dr. Johnstone