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
computer animation Note : This is to be noticed that computer animation can also be produced by changing camera parameters as its position, orientation and focal length, as w

Scan Line Polygon Fill Algorithm - Raster Graphics In such algorithm, the information for a solid body is stored in the frame buffer and utilizing that information each pixel

Q. What is a Bezier Curve? What are blending function? Write an algorithm for generating Bezier Curves. A curve which has the following properties is called Bezier Curve: 1. A

deffrent between vecgen algorithm and bresenham line algorithm in computer graphic

Example: Exemplify the Bresenham line generation algorithm through digitizing the line along with end points (20, 10) and (30, 18) Solution: m =    (y2 - y1)/( x2 - x1)  =

Uniform B - spline curve: When the spacing between Knot values is constant, the resulting curve is called a uniform B- spline. Blending function for B- spline curves are defined b


3-D Modeling and Animation Tools: By 3-D modeling software, objects rendered in perspective show more realistic. One can produce stunning scenes and wander by them, choosing just

Scientific Visualization This is complex for the human brain to create sense out of the large volume of numbers produced through a scientific computation. Statistical and nume

Polygon representation methods - Boundary representations Boundary representations: now the 3-D object is shown as a set of surfaces which separate the object interior from