Computer Science 385.3 Term 1, 2006 Tutorial 1. Tutorial Leader ● Jeremy Long – B. Sc. in Computer Science (2005) – M. Sc. in Computer Science (2007,

Slides:



Advertisements
Similar presentations
Our Friend the Dot Product
Advertisements

Physics: Principles with Applications, 6th edition
IS660Z Programming Games Using Visual Basic Overview of Cannonball.
Visual Basic: ballistics
Vector Operations Chapter 3 section 2 A + B = ? B A.
Three Dimensional Viewing
Chapter 4. Kinematics in Two Dimensions
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry Trigonometric functions Defined using right triangle  x y h.
Using the “Clicker” If you have a clicker now, and did not do this last time, please enter your ID in your clicker. First, turn on your clicker by sliding.
Using the “Clicker” If you have a clicker now, and did not do this last time, please enter your ID in your clicker. First, turn on your clicker by sliding.
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.
Introduction What is this ? What is this ? This project is a part of a scientific research in machine learning, whose objective is to develop a system,
Instructor: Dr. Tatiana Erukhimova
Computer Animations of Molecular Vibration Michael McGuan and Robert M. Hanson Summer Research 2004 Department of Chemistry St. Olaf College Northfield,
Physics Simple – Pong Medium – Rigid bodies F = ma Circles, spheres, rectangles for collisions Complex – Fluids, clothings, explosions, hair.
Linear Algebra Review CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2005.
CAP4730: Computational Structures in Computer Graphics
2D Transformations. World Coordinates Translate Rotate Scale Viewport Transforms Hierarchical Model Transforms Putting it all together.
Game Physics – Part IV Moving to 3D
WP3 - 3D reprojection Goal: reproject 2D ball positions from both cameras into 3D space Inputs: – 2D ball positions estimated by WP2 – 2D table positions.
CSE 380 – Computer Game Programming Box2D Box2D TestBed.
Learning Game Maker Studio:
CSCE 552 Spring 2011 Math By Jijun Tang. Layered.
Simulating the Physics of Pool using RenerMan ● Shaders and Texture Mapping ● Spherical Texture Maps ● Rotating the Balls ● Lighting ● Physics Equations.
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 7 The Game Loop and Animation Starting Out with Games & Graphics.
CO1301: Games Concepts Dr Nick Mitchell (Room CM 226) Material originally prepared by Gareth Bellaby.
Vector Addition – Computational Method Example 1 Slide 3.
Vectors and Two Dimensional Motion Chapter 3. Scalars vs. Vectors Vectors indicate direction ; scalars do not. Scalar – magnitude with no direction Vector.
Neo-Breakout Sonhui Schweitzer CS 470 Spring 2005.
Matthew Christian. About Me Introduction to Linear Algebra Vectors Matrices Quaternions Links.
Computer Science Term 1, 2006 Tutorial 2 Assignment 3 – The Virtual World.
Advanced Computer Graphics Rigid Body Simulation Spring 2002 Professor Brogan.
Vector components and motion. There are many different variables that are important in physics. These variables are either vectors or scalars. What makes.
Exam 2 Review 8.02 W08D1. Announcements Test Two Next Week Thursday Oct 27 7:30-9:30 Section Room Assignments on Announcements Page Test Two Topics: Circular.
Introduction to Particle Simulations Daniel Playne.
Spring Rigid Body Simulation. Spring Contents Unconstrained Collision Contact Resting Contact.
Collision Detection And Response Jae Chun KyungSoo Im Chau Vo Hoang Vu.
Geometric Transformations
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
Maths Fundamentals Games Fundamentals © by Jarek Francik Kingston University, London
Physics 211 Second Sample Exam Fall 2004 Professors Aaron Dominguez and Gregory Snow Please print your name _______________________________________________________________.
Honours Graphics 2008 Session 2. Today’s focus Vectors, matrices and associated math Transformations and concatenation 3D space.
Physics Unit 3 FORCES Unit 3 Lesson 6 Objectives: Word Problems with VECTORS Do Now  Page 142 Problem 85 Homework  3 Vector Problem  Slide 1.
CS5500 Computer Graphics April 23, Today’s Topic Details of the front-end of the 3D pipeline: –How to construct the viewing matrix? –How to construct.
Introduction to Game Programming & Design III Lecture III.
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
Write Bresenham’s algorithm for generation of line also indicate which raster locations would be chosen by Bresenham’s algorithm when scan converting.
Section 3-4 Radian Measures of Angles. Definition: Radian Measure of an Angle.
Forward Projection Pipeline and Transformations CENG 477 Introduction to Computer Graphics.
Chapter 3 Kinematics in Two Dimensions; Vectors
Modeling Transformations
Kinematics in Two Dimensions; Vectors
Vectors Vector: a quantity that has both magnitude (size) and direction Examples: displacement, velocity, acceleration Scalar: a quantity that has no.
Chapter 3 Kinematics in Two Dimensions; Vectors
Physics: Principles with Applications, 6th edition
Impulse and Momentum AP Physics 1.
Kinematics in Two Dimensions; Vectors
Physics: Principles with Applications, 6th edition
Kinematics in Two Dimensions
Instructor: Dr. Tatiana Erukhimova
5.3 Components of Vectors The perpendicular components of a vector are independent of each other.
Physics: Principles with Applications, 6th edition
Physics: Principles with Applications, 6th edition
Vector components Resolving Vectors.
Programming games Demonstrate cannonball
CS5500 Computer Graphics April 24, 2006.
Collisions Chapter 4.
Displacement, speed, velocity, acceleration and momentum
Physics: Principles with Applications, 6th edition
Instructor: Dr. Tatiana Erukhimova
Presentation transcript:

Computer Science Term 1, 2006 Tutorial 1

Tutorial Leader ● Jeremy Long – B. Sc. in Computer Science (2005) – M. Sc. in Computer Science (2007, hopefully) ● Supervisor: Dr. David Mould – Research Interests: ● Computer Graphics: NPR, procedural modeling, nonlinear raytracing. ● Contact Info: – (jsl847 at mail.usask.ca) – Phone: – Office: IMG Lab, G60 Thorvaldson

Tutorials ● Tutorial Sections: – Thursday – 4:00-5:20, S311. – Friday – 1:30-3:00, S311. ● 5 Tutorials throughout the term

Assignment 1 – Pool Table Simulation -Part 1: The Pool Balls -Part 2: User Input -Part 3: Simulation Step -Part 4: Collisions -Part 5: Matrix Math Tutorial Outline

Assignment 1 – Pool Table Simulation Part 1 – Pool Balls ball { radius; // Radius of the ball positionX, positionY; // 2-dimensional coordinates velocityX, velocityY; // velocity broken down in x and y active; // indicates whether this ball is still in play } Rendering Circles 360 degrees = 2pi radians CircleX = positionX + cos(Radians) * radius CircleY = positionY + sin(Radians) * radius

Assignment 1 – Pool Table Simulation Part 2 – User Input mouseFunction( int button, int state, int sx, int sy) { // You should first convert Screen Coordinates to world coordinates if (left button is pushed down) { if (cueBall is near click coordinates) { get ball coordinates mouseDown = true } } if (left button is released) { if (mouseDown) { set cueBall velocity based on new mouse position }}

Assignment 1 – Pool Table Simulation Part 3 – Simulation Step The simulation step will be done in the program’s idle function, and will need to perform the following tasks. -Check if any active balls are in a pocket. -Check if any active balls have collided with the walls or other active balls. -Update the locations of the active balls based on their velocity. -Apply friction to the velocities of all active balls.

Assignment 1 – Pool Table Simulation Part 4 – Collisions Once we have detected a collision, how do we resolve it? -Collisions are elastic, so momentum and velocity is preserved. Collisions with the Wall: -Reverse the velocity component perpendicular to the wall in question. Collisions with other balls: -More complicated – see Assignment 1 description for diagrams.

Assignment 1 – Pool Table Simulation Part 4 – Collisions for each ball in the collision { normalize the current ball's velocity vector – v1 (each component/the vector's length) find vector pointing to the other ball in the collision - v2 normalize each component of v2 get the cosine by taking the dot product of v1 and v2 find new horizontal vector h1 reposition the vertical vector v0 based on h1 setVelocity(Hx1 + Vx0, Hy1 + Vy0) // set x and y velocities based on vectors calculated. }

Assignment 1 – Pool Table Simulation Part 5 – Math Questions Two translation matrices: x y z a b c * x y z a b c * = Rotation: cosAsinA -sinAcosA

Questions Special thanks to our dark sponsor, Coca-Cola.