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
Multimedia: it is the use of different media to present a specific subject. This representation itself is a multimedia presentation implies; it brings together text and graphics.

Associative Links: it is a link that is completely independent of the exact structure of the information. For illustration we have links depends on the meaning of various informat

Normal 0 false false false EN-IN X-NONE X-NONE MicrosoftInternetExplorer4

Important points about the Surface of Revolution a) if a point on base curve is given by parametric form, that are: (x(u), y(u), z(u)) so surface of revolution regarding to th

Animation, Video and Digital Movies : These are sequences of bitmapped graphic scenes or frames, quickly played back. But animations can also be made inside the authoring system t

?What is Computer Resolution?

Geometric tables - Polygon Tables 1) Vertex table: Keep vertices' coordinates values in the object. 2) Edge table: Keep pointers back in to the vertex table for identif

Implement displacement mapping and bump mapping on a sphere. The displacement can be whatever your choice. The bump map can be whatever your choice as well.

How many 128 x 8 RAM chips are needed to provide a memory capacity of 4096 16 bits?

1. Explain the Bresenham line generation algorithm via digitizing the line with end  points as (15, 5) and also (25,13). Ans. Now we are utilizing the Bresenham line generati