Project 6 Tumbling Cube Fri, Nov 21, 2003 Due Mon, Dec 8, 2003.

Slides:



Advertisements
Similar presentations
Lines, Lines, Lines!!! ~ Horizontal Lines Vertical Lines.
Advertisements

Lets count the Faces on a cube ©. Use the letter F for the number of Faces ©
More Vectors.
4.7 Graphing Lines Using Slope Intercept Form
Section 3-1 to 3-2, 3-5 Drawing Lines Some of the material in these slides may have been adapted from university of Virginia, MIT, and Åbo Akademi University.
IS660Z Programming Games Using Visual Basic Overview of Cannonball.
Visual Basic: ballistics
Computer Graphics Lecture 4 Geometry & Transformations.
Intersection Testing Chapter 13 Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
Flash Animation Using Linear Transformations By Kevin Hunter Kevin Hunter Marcus Yu Marcus Yu.
1 Computer Graphics Chapter 8 3D Transformations.
How to Construct a Paper Airplane. Start Small Plane: Tear.
Frank L. H. WolfsDepartment of Physics and Astronomy, University of Rochester Physics 121. March 18, 2008.
CS 4731: Computer Graphics Lecture 11: 3D Viewing Emmanuel Agu.
Introduction to 3D viewing 3D is just like taking a photograph!
Section 9.5: Equations of Lines and Planes
Week 2 - Wednesday CS361.
Week 5 - Wednesday.  What did we talk about last time?  Project 2  Normal transforms  Euler angles  Quaternions.
Billiards and Snooker are some of the most mathematical of games. Why is that? This lesson explores some of the interesting patterns that are created when.
With Diego Forlan. F = 6 © Equation F + C – E = ©
CS 450: COMPUTER GRAPHICS PROJECTIONS SPRING 2015 DR. MICHAEL J. REALE.
Warm-Up What 3-d geometric shape will the following nets fold to create? 1) 2) 3)
Computer Graphics Zhen Jiang West Chester University.
Earth’s Rotation K. Williams, PRES. We live on Earth.
2003CS Hons RW778 Graphics1 Chapter 7: Three-Dimensional Viewing Chapter 5: Camera with parallel projection Chapter 5: Camera with parallel projection.
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)
Advanced Viewing Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Friday, October 31, 2003.
1 Graphics CSCI 343, Fall 2015 Lecture 6 Viewing, Animation, User Interface.
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
Lecture 5: Introduction to 3D
Coordinate Systems Lecture 1 Fri, Sep 2, The Coordinate Systems The points we create are transformed through a series of coordinate systems before.
CHAPTER 8 Rotational Kinematics. Go to this page on your laptop or computer: ◦ ms/Labs/ClassicCircularForceLab/index.html.
9.3 – Perform Reflections. Reflection: Transformation that uses a line like a mirror to reflect an image Line of Reflection: Mirror line in a reflection.
III- 1 III 3D Transformation Homogeneous Coordinates The three dimensional point (x, y, z) is represented by the homogeneous coordinate (x, y, z, 1) In.
2D Transformation Homogenous Coordinates Scale/Rotate/Reflect/Shear: X’ = XT Translate: X’ = X + T Multiple values for the same point e.g., (2, 3, 6)
Viewing and Projection. The topics Interior parameters Projection type Field of view Clipping Frustum… Exterior parameters Camera position Camera orientation.
MATH 1330 Section 4.3 Trigonometric Functions of Angles.
PHY 102: Lecture Symmetry 3.2 Concept of Flux 3.3 Calculating Electric Flux 3.4 Gauss’ Law.
Trigonometry and Applications References: xyz. Review (?) from ETGG1801 Angles – As a measure of rotation and/or orientation – Radians & Degrees (and.
Slope of Parallel Lines The slope of a nonvertical line is the ratio of the vertical change (the rise) to the horizontal change (the run). If the line.
2-3C Parallel and Perpendicular Lines 2-3C Parallel and Perpendicular Lines Objectives: How do you know if slopes are parallel or perpendicular? What are.
Introduction to Game Physics
Sec. 2-2: Linear Equations 9/19/17
Ways to represent them Their uses
CSCE 441 Computer Graphics 3-D Viewing
3.6 Parallel Lines in a Coordinate Plane
Trigonometry bouncing_ball.py
Class 10 Part 1 What values to use for Frustum The Trick
Honors Physics 1 Class 12 Fall 2013
Viewing Transformations
Three Dimensional Viewing
Computer Graphics Imaging
Computer Graphics Lecture 20
3-6 Parallel Lines in the Coordinate Plane
Animation Lecture 17 Wed, Oct 3, 2007.
Parallel Lines in Coordinate Plane
2D Graphics Lecture 4 Fri, Aug 31, 2007.
Viewing (Projections)
The View Frustum Lecture 10 Fri, Sep 14, 2007.
Reflections in Coordinate Plane
2-3C Parallel and Perpendicular Lines
Viewing (Projections)
Class 10 Part 1 What values to use for Frustum The Trick
Warm up Write an equation given the following information.
Objective graph linear equations using slope-intercept form.
Perpendicular and Parallel Lines
3.6 Parallel Lines in the Coordinate Plane
By: Harshal Nallapareddy and Eric Wang
α The terminal side of the angle here is r
Warm-Up 1.) Using the point slope formula find the equation of a line with slope -2 , passing through the point (1, 3) 2.) Graph the line y = 3x + 4.
Presentation transcript:

Project 6 Tumbling Cube Fri, Nov 21, 2003 Due Mon, Dec 8, 2003

Tumbling Cube Read the handout.handout Run Tumbling Cube.exe.Tumbling Cube.exe

The Motion of the Cube The cube should move in a specified direction at a specified speed. It should also spin on a specified axis at a specified rotation rate.

The Motion of the Cube You should create the following global variables. A point to store the cube’s position. A vector to store the direction of motion. A vector to store the axis of rotation. A float to store the spin angle of about the axis of rotation.

Animation The animation will be handled in the idle() function. This is a callback function that is called whenever nothing else is happening. The prototype is void idle();

Animation The function clock() returns the number of milliseconds since the computer was last turned on. Use clock() to compute the elapsed time since the last call to idle(). Then update the cube’s position and spin angle.

Animation New position = old position + direction * elapsed time. New angle = old angle + spin rate * elapsed time.

Animation Then determine whether the cube bounced off any of the six faces of the frustum. If it did, then update the position of the cube.

The View Frustum The cube will bounce around inside the view frustum.

The View Frustum Use gluPerspective() to create the projection matrix for this frustum. You may use any angle, but I think a 90  angle will be easy to work with. This is the angle between the top and bottom faces of the frustum. The angle between the sides is determined by this angle and the aspect ratio.

The Top and Bottom Walls of the Frustum Assume the angle is 90 . What are the equations of the top and bottom walls? What is the equation?Top wall z y 10 What is the intercept?

The Left and Right Walls of the Frustum To find the side walls, we must take the aspect ratio into account. x z 10 10*(aspect ratio) Right wall What is the equation?

Bouncing off the Walls The motion is in discrete jumps, so the cube will probably pass through the wall in one of its “jumps.”

Bouncing off the Walls When the center of the cube “passes through” a wall, we will relocate the center to the point where the cube would be if it bounced off the wall.

Bouncing off the Walls How do we calculate the new location of the cube? x = a (x 0, y 0 ) (x 1, y 1 )(x 2, y 2 )

Bouncing off the Walls We will assume that the walls are parallel to the coordinate planes for the purpose of computing the reflected location, even though the wall is at an angle. Real wall Pretend wall

Bouncing off the Walls If we didn’t do that, then the cube might get stuck in a corner.