Finding where the ball hits a segment, Computer Graphics

You will write a two-dimensional precursor of the three-dimensional bouncing ball simulation that is one of your choices for a ?nal project. This involves adding functions to your Frame and Polyline classes, creating a new base component, Polybounce, which has the same role as your Animation class from assignment 6 and updating your main program and Display class to support the new functionality.

Note that you are extending Frame and Polyline. These should continue to work with your earlier applications.

Procedure

1. Modify your Animation class to include an instance of Ball but just a single Frame. Make sure to add the Ball to your reDisplay function. Initialize the ball with a reasonable radius (I used 0.1), your favorite color, at position h0.5, 0.5i (which should be the center of your initial world window) and a reasonably small velocity (h0.05.0.05i works well). So your initialization may look like

_b = Ball(0.1,
GLTYPES::GLred3,
GLTYPES::Coord2(0.5,0.5,1),
GLTYPES::Coord2(0.05,0.05,0))

  • main program

- Display
∗ instance of Polybounce
∗ other components
∗ callback functions
∗ animation timer
∗ plumbing between components
∗ This is not a component. It is the class that initializes the display and partitions it between the components. It knows screenheight andscreenwidth.

- Callback wrappers
- main()

Posted Date: 3/14/2013 1:14:52 AM | Location : United States







Related Discussions:- Finding where the ball hits a segment, Assignment Help, Ask Question on Finding where the ball hits a segment, Get Answer, Expert's Help, Finding where the ball hits a segment Discussions

Write discussion on Finding where the ball hits a segment
Your posts are moderated
Related Questions
PCs or Personal Computers Really - Hardware for Animation  these are really versatile machines that have been around for years. PCs are the favorite of many computer users, due

Cyrus Beck Algorithm - Line Clipping Algorithm Cyrus Beck Line clipping algorithm is actually, a parametric line-clipping algorithm. The term parametric means that we requi

Question 1 Describe the process of formation of image in human eye Structure of the Human Eye Image formation in the Eye Brightness Adaptation and Discrimination

I need different convincing virtual environments (2D and 3D) that alter size perception. In particular, for 2D environment or background, when any object is augmented with the 2D e

What are the advantages of rendering polygons by scan line method?  i. The max and min values of the scan were simply found.  ii. The intersection of scan lines with edges i

Traditional Animation techniques as: 1) Key Frames                        2) Cel Animation Formula: Required Key frames for a film = {[Time(in seconds)]


Global illumination model -polygon rendering This illumination model adds to the local model the light which is reflected from the other surfaces to the current surface. This

Mathematical description of a Perspective Projection A perspective transformation is found by prescribing a center of projection and a viewing plane. Let here assume that P(x

Write a program in C/C++ using OpenGL to create (without using built in function) a square by implementing shear algorithm along 1. X-axis, 2.Y-axis.