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
Draw the block diagram of raster scan display processor.

1. Modify the DDA algorithm for negative sloped lines; discuss both the cases i.e., slope > 1 and 0   Ans. For the generation of lines along with negative slopes as:

Aspect ratio - Display Devices Ratio of vertical points to horizontal points necessary to produce equal length lines in both directions on the screen. For example, in a CRT mon

Define the working procedure of CRT with diagram

Cases for Subdivisions of Polygon No additional subdivisions of a particular area are desired, if one of the subsequent conditions is true as: Case 1: All the polygons ar

State the technology used in LCD Some passive matrix (Pixels are illuminated in scanline order like a raster display but  the lack of phospherescence causes flicker) LCDs have

State the Advantages AND Disadvantages of CAD       Advantages of CAD                                                               Disadvantages of CAD - Easier to modif

Education - applications for computer animation Currently, studies of subjects as Art, Physics, Maths, Chemistry, Biology, Engineering, Medicine, and Technology are fairly simp

2D Line Segment Generation  A digitally plotted line is basically an approximation of infinite number of points on an abstract line segment by only a finite number of points on

Find the normalization transformation N, which uses the rectangle W(1, 1); X(5, 3); Y(4, 5) and Z(0, 3) as a window and the normalized deice screen as viewpoint.