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
An animation demonstrates a car driving along a road that is given by a Bezier curve along with the subsequent control points:  X k 0 5


write digital differntial analyzers(DDA) Algorithm

Introduction of Viewing  Transformations Projection is fundamentally a transformation or mapping of 3D objects upon 2D screen. Projection is mostly categorised in Para

Sketch Line Segment That Joining By Using Bresenham Line Algorithm Example: Sketch line segment that joining (20, 10) and (25, 14) by using Bresenham line generation algorit

Write a C-code that plots an object on the window and on the user's click of mouse on the window, the object starts rotating continuously until the user presses the mouse again.

Military: In order to enter the military, one has to go by various training. Depending upon whether you want to be in the army, navy or the marines, you may be working along with

Forensics: Accidents occur every minute. Very frequently, there are no witnesses except for the individuals concerned in the accident or worse yet, there are no surviving witnesse

Light Sources - polygon rendering and ray tracing methods Light Sources are key parts in any ray traced scene, since without them; there would be no rays to trace. Light sour

B-spline curves - clipping and 3d primitives B-spline curves are piecewise polynomial cubes with one or more polynomial pieces with a minimum smoothness requirement.  For examp