Finding where the ball hits a segment, Computer Graphics

Assignment Help:

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()


Related Discussions:- Finding where the ball hits a segment

Determine the advantages of raster-scan systems, Determine the advantages o...

Determine the advantages of raster-scan systems (i)  Rasterisation is now performed faster since a special purpose processor is used. (ii)  The CPU is not slowed down by the

Explain about unified memory architecture, Q. Explain about Unified Memory ...

Q. Explain about Unified Memory Architecture? UMA signifies Unified Memory Architecture. It is an architecture that reduces the cost of PC construction.  In this a part of main

Scaling, Scaling, shear, reflection and Viewing coordinates 1) Scaling,...

Scaling, shear, reflection and Viewing coordinates 1) Scaling, shear and reflection operations have natural extensions to 3D.    2)  Viewing coordinates are the coordinates

Images - systems research group, The image you have been given for contour ...

The image you have been given for contour extraction is shown in Figure 1. The method for constructing the search space is shown in Figure 2. It is generated from two initial discr

Projections - viewing transformation, Projections - Viewing Transformation ...

Projections - Viewing Transformation Specified 3-D object in a space, Projection can be explained as a mapping of 3-D object into 2-D viewing screen. Now, 2-D screen is termed

What do you mean by high definition systems -what is dvst, what do you mean...

what do you mean by high definition systems? Define aspect ratio?  What is a refresh buffer? What is the difference between bitmap and pitman frame buffer? Explain the basic oper

Texturing - texture coordinate, Background Texturing is like wallpaperin...

Background Texturing is like wallpapering; you are pasting an image onto the OpenGL Quad primitive.  Recall that GL_QUAD is specified by four vertices.  An image, or a texture,

Briefly explain how the median filter works, QUESTION 1 (a) Write a run...

QUESTION 1 (a) Write a run method in Image J environment for the following cases Contrast and Brightness Histogram Generation Histogram Equalisation   (b)

Linearly interpolate - modeling and rendering, Linearly interpolate - Model...

Linearly interpolate - Modeling and Rendering I 4 = I 1 + t (I 2 - I 1 ); here t = (|y 1 - y 2 |)/(|y 1 - y 2 |) I D = I A + t (I B - I A ); here t = (|AD|)/(|AB|)

Containment test - visible surface detection, Containment Test -  visible s...

Containment Test -  visible surface detection Test: That is Containment test: it can be either comprised (contained) or surrounding polygon, if intersection test fails. The

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd