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.


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,

  • 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
What is Multimedia: People only remember 20 percent of what they see and 30 percent of what they hear. But they keep in mind 50 percent of what they see and hear and as much as 80

Steps uses in the Cohen Sutherland Line Clipping Algorithm are: Figure: Steps for Cohen Sutherland Line Clipping STEP 1: Input:  x L , x R , y T , y B

Read the next page and work through the steps: a.  Select a location (anywhere in the world) and research the typical weather (temperature, barometric pressure, and humidity).

Question 1 What is JPEG? How do you change the quality of a JPEG image? Question 2 What are the advantages and challenges of virtual classroom? Question 3 What do

boundary-fill algorithm or flood-fill algorithm As you saw the implementation of scan line polygon fill requires that boundaries should be straight line segments.  The seed fi

Low level techniques (motion specific) Techniques utilized to fully control the motion of any graphic object in any type of animation scene, these techniques are also considere

Write short notes on rendering bi-cubic surface patches of constant u and v method?  The simple way is to draw the iso-parmetric lines of the surface. Discrete approximations t

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.

Question 1: (a) The studio provides a perfect environment for various types of video production where precise control is necessary. Discuss. (b) Studio lighting is an import

In this programming assignment, you will animate and pose 3D articulated characters by implementing forward and inverse kinematic methods. You should be able to animate character j