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
Consequently some methods are utilized to handle this huge information and these methods are termed as animation process that are classified as: First Method: In this method,

Translation, Rotation and Scaling -  output primitives 1. Two basic approaches used in character generation are - Bitmap method and outline method.  2. All 2D geometric tran

What do you mean by parabolic splines?  For parabolic splines a parabola is fitted by the first three points p1, p2,p3 of the data array of kot points. Then a second parabolic

IFF: It is Amiga Interchange File Format which is used to transfer documents to and from Commodore Amiga Computers. This format is really flexible and permits images and text to b

Buffer Areas Required For Z-Buffer Algorithm For applying z-buffer algorithm, we need two buffer areas or two 2-Dimentional arrays: 1) Depth-buffer [i,j], to sa

Archeology: along with the advent of the computer, the archeologist has obtained a new tool, computer animation. An object-model can be made comparatively quick and without any we

determine the form of the transformation matrix for a reflection about an arbitrary line with equation y=mx+b.

QUESTION A trainee designer, Susan, joins your place of work. During a workshop, you are asked to present on printing procedures and agencies in Mauritius. Susan asks you what

Question 1 How does GIS differ from traditional Maps? Explain Question 2 Explain vector data model with examples Question 3 What is spatial analysis? explain

What do you mean by Perspective projection?  Perspective projection is one in which the lines of projection are not parallel. Instead, they all converge at a single point known