Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may.

Slides:



Advertisements
Similar presentations
AITI Lecture 19 Linked List Adapted from MIT Course 1.00 Spring 2003 Lecture 26 and Tutorial Note 9 (Teachers: Please do not erase the above note)
Advertisements

Databases. A database program can be used to:  sort a file into a different order  Maintain contact with clients  search through the records for a.
I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 30, D Clipping 1/14 Clipping (pages , )
C HAPTER 9 PRICING: Understanding and Capturing Customer Value CRS Questions & Answers.
CSE 681 Bounding Volumes. CSE 681 Bounding Volumes Use simple volume enclose object(s) tradeoff for rays where there is extra intersection test for object.
2.3. B OUNDING V OLUMES Bounding volumes of use for collision detection.
Collision Detection CSCE /60 What is Collision Detection?  Given two geometric objects, determine if they overlap.  Typically, at least one of.
Collision Detection and Resolution Zhi Yuan Course: Introduction to Game Development 11/28/
Query Processing in Databases Dr. M. Gavrilova.  Introduction  I/O algorithms for large databases  Complex geometric operations in graphical querying.
With Microsoft Access 2010© 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access.
Property of Virginia Beach City Public Schools ©2012 by Virginia Beach City Public Schools, P.O. Box 6038, Virginia Beach, Virginia All rights.
Computer Science 1000 Spreadsheets II Permission to redistribute these slides is strictly prohibited without permission.
CS 325 Introduction to Computer Graphics 03 / 03 / 2010 Instructor: Michael Eckmann.
Warm-Up 5 minutes 1) On the coordinate plane, graph two lines that will never intersect. 2) On the coordinate plane, graph two lines that intersect at.
Multiple Integration 14 Copyright © Cengage Learning. All rights reserved.
Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may.
CS 325 Introduction to Computer Graphics 03 / 08 / 2010 Instructor: Michael Eckmann.
Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may.
Property of Virginia Beach City Public Schools ©2014 by Virginia Beach City Public Schools, P.O. Box 6038, Virginia Beach, Virginia All rights.
Copyright © 2015, 2011, 2007 Pearson Education, Inc. 1 1 Chapter 4 Systems of Linear Equations and Inequalities.
Lecture X Augmenting Data Structures
CS 325 Introduction to Computer Graphics 04 / 26 / 2010 Instructor: Michael Eckmann.
Copyright © 2010 Pearson Education, Inc. All rights reserved Sec
HALLOWEEN A FUN STUDY By: Inspiring NH Kids
LINEAR SYSTEMS – Graphing Method In this module, we will be graphing two linear equations on one coordinate plane and seeing where they intersect. You.
Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may.
GRAPHING SYSTEMS OF EQUATIONS Algebra 1: Unit 7. GRAPHING LINEAR EQUATIONS.
CSC 211 Data Structures Lecture 13
Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may.
CIS 350 – I Game Programming Instructor: Rolf Lakaemper.
Chapter 4 Section 1. Objectives 1 Copyright © 2012, 2008, 2004 Pearson Education, Inc. Solving Systems of Linear Equations by Graphing Decide whether.
Database Fundamental & Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may.
Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may.
Microsoft Project User Group May 2002 – Chapter Meeting Scheduling - Best Practices Initiation and Planning Presented by James Nuthall Brentford Technologies,
Sorting & Searching Review. Selection Sort 1. Find the smallest element 2. Move to the front of the array (swap with front) 3. Repeat Steps 1&2, but ignoring.
1 Sage Demo 4 Collisions SAGE Lecture Notes Ian Parberry University of North Texas.
A: A: double “4” A: “34” 4.
Double Integrals in Polar Coordinates. Sometimes equations and regions are expressed more simply in polar rather than rectangular coordinates. Recall:
Computer Game Design and Development Collision Detection Havok Destruction.
Searching CSE 103 Lecture 20 Wednesday, October 16, 2002 prepared by Doug Hogan.
Priority Queues CS /02/05 L7: PQs Slide 2 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved.
Ray Tracing Acceleration (1). Acceleration of Ray Tracing Goal: Reduce the number of ray/primitive intersections.
Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may.
 2016, Marcus Biel, Marcus Biel, Software Craftsman Identity vs Equality in Java
CS552: Computer Graphics Lecture 12: 3D Clipping.
3D Game Development and Computer Animation Collision Detection
INTERMEDIATE PROGRAMMING USING JAVA
Intro & Point-to-Box, Circle-to-Circle, Point-to-Circle
Collision Detection Box-to-Box.
GO! with Microsoft Office 2016
Scene Modeling for a Single View
Copyright © Cengage Learning. All rights reserved.
Prof. Harriet Fell Spring 2007 Lecture 26 – March 19, 2007
Query Processing in Databases Dr. M. Gavrilova
Prof. Harriet Fell Fall 2011 Lecture 24 – November 2, 2011
Chapter 4 LOOPS © Bobby Hoggard, Department of Computer Science, East Carolina University / These slides may not be used or duplicated without permission.
Review Operation Bingo
Intro to lighting (Chapter 11)
ServiceLink Training Video Entering Job Referral Outcomes
ServiceLink Training Video Adding Client Work Experience
No part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior.
Legislator Ideal Points from Classical OC and Issue-Specific OC (113th Congress). Adam Bonica rsf 2016;2:11-32 Copyright © 2016 by Russell Sage Foundation.
What you will learn today
Building Java Programs
Comparison of Scores for Candidate Ideology Generated from Different Data Sources. Adam Bonica rsf 2016;2:11-32 Copyright © 2016 by Russell Sage Foundation.
that ordered pair is the one solution.
APPLES A FUN STUDY By: Inspiring NH Kids
Introduction to Sampling Distributions
Graphing Systems of Equations.
Presentation transcript:

Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the author. CS 497: Computer Graphics James Money

Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the author. Object Collision What happens if a viewer walks into an object right now?

Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the author. Object Collision You walk right through the object!

Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the author. Object Collision What do we need to determine when a view comes in contact with an existing object? We need to determine the intersection of two volumes.

Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the author. Object Collision However, intersecting objects is an expensive operation. If we operate on bounding volumes, we can make this a simple operation. We just can check the bounding coordinates of the object’s volume!

Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the author. Object Collision Boolean Intersect(Object1 *obj1,Object2 *obj2){ if ((obj1->minX minX) && (obj1->maxX > obj2->minX)) || ((obj1->minX maxX) &&(obj1->maxX > obj2->maxX)){ if ((obj1->minY minY)&&(obj1->maxY>obj2->minY)) || ((obj1->minY maxY) &&(obj1->maxY>obj2->maxY)){ if ((obj1->minZ minZ) && (obj1->maxZ > obj2->minZ)) || ((obj1->minZ maxZ) &&(obj1->maxZ > obj2->maxZ)){ return TRUE; } if ((obj2->minX minX) && (obj2->maxX > obj1->minX)) || ((obj2->minX maxX) &&(obj2->maxX > obj1->maxX)){ if ((obj2->minY minY)&&(obj2->maxY>obj1->minY)) || ((obj2->minY maxY) &&(obj2->maxY>obj1->maxY)){ if ((obj2->minZ minZ) && (obj2->maxZ > obj1->minZ)) || ((obj2->minZ maxZ) &&(obj2->maxZ > obj1->maxZ)){ return TRUE; } return FALSE; }

Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the author. Object Collision int Polygon3D::PtInPolygon(Point3D &pt){ double total=pt.x*N->v[0] + pt.y*N->v[1] + pt.z*N->v[2] + N->v[3]; if (fabs(total) > 0.5E-5) return FALSE; int numEdges=0; double tx,ty,tz; for(int I=0;I<(numPoints-1);I++){ tx=(pt.x - pts[I].x)/(pts[I+1].x + pt.x - pts[I].x - maxX); ty=(pt.y - pts[I].y)/(pts[I+1].y + pt.x - pts[I].y - maxY); tz=(pt.z - pts[I].z)/(pts[I+1].z + pt.z - pts[I].z - maxZ); if (((tx>=0.5E-5) && (tx<= )) && ((ty>=0.5E-5) && (ty<= )) && ((tz>=0.5E-5) && (tz<= ))) numEdges++; } tx=(pt.x - pts[numPoints-1].x)/ (pts[0].x + pt.x - pts[numPoints-1].x - maxX); ty=(pt.y - pts[numPoints-1].y)/ (pts[0].y + pt.x - pts[numPoints-1].y - maxY); tz=(pt.z - pts[numPoints-1].z)/ (pts[0].z + pt.z - pts[numPoints-1].z - maxZ); if (((tx>=0.5E-5) && (tx<= )) && ((ty>=0.5E-5) && (ty<= )) && ((tz>=0.5E-5) && (tz<= ))) numEdges++; if (numEdges & 1) return TRUE; return FALSE; }

Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the author. Moving Up in the World Now we can detect if the user runs into an object in the world. What about stepping on objects or falling?? For stepping up, we can just check to see if the user’s height/4.0 is greater than the height from where you currently are and the top(Y max ) of the bounding rectangle of the object.

Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the author. Falling in the world! Now for falling, we have to check to see if the base of of the user object if equal to the base of some object in the world.(Remember in intersection that we don’t check if it’s equal!) We can make it easy by checking the point at the middle of the object on the bottom face of the user.

Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the author. Falling in the world! To make things easy, we keep a record of the last item you were on top of, and check it first. It the points fits the plane equation for that polygon, we do nothing. If not, we search for a polygon in the current room that has a normal that satisfies this point and save that polygon for next time. If none exists, we drop in world Y coordinates by some value(perhaps 0.2 meters) until we hit a polygon.

Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the author. Falling in the world! To make things even easier, we will not check an object in the room whose X min, X max, Y min, Y max are not within our X,Y user position at the base.