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

Ray tracing - polygon rendering and ray tracing methods, Ray Tracing - Poly...

Ray Tracing - Polygon Rendering and Ray Tracing Methods Basically Ray tracing is an exercise that is performed to attain the realism in a scene. In easy way Ray Tracing is a w

Softwares and hardwares for computer animation, Softwares and Hardwares for...

Softwares and Hardwares for Computer Animation The categories of both software as well as hardware needed to work on animation are now to be discussed. Computer animation can b

Midpoint circle algorithm for scan converting a circle, Explain Bresenham s...

Explain Bresenham s circle drawing algorithm,  OR   Explain midpoint circle algorithm for scan converting a circle. Midpoint Circle Algorithm   1. Input radius r and circle

Principal vanishing point write respect to y-axis, Principal vanishing poin...

Principal vanishing point write respect to y-axis By the 2nd Row of the matrix as in Equation, the principal vanishing point w.r.t y-axis will as: (0, 5/√2, 0, 1/√2) in hom

Traditional animation techniques , Traditional Animation techniques as: ...

Traditional Animation techniques as: 1) Key Frames                        2) Cel Animation Formula: Required Key frames for a film = {[Time(in seconds)]

Military-applications for computer animation, Military: In order to enter ...

Military: In order to enter the military, one has to go by various training. Depending upon whether you want to be in the army, navy or the marines, you may be working along with

Describe digital printing and prepress, Question 1: (a) Describe Digita...

Question 1: (a) Describe Digital Printing and Prepress? Also state the advantages and disadvantages of Digital printing? Question 2: (a) What are the three most import

Prepare a cylinder, Question: (a) Write a short note on the dot syntax...

Question: (a) Write a short note on the dot syntax as used in actionScript. (b) A data type describes the kind of information a variable or ActionScript element can hold.

Explain the lofting method in maya, QUESTION 1: a) Draw a Bezier curve ...

QUESTION 1: a) Draw a Bezier curve showing the following components i. hull ii. curve CV iii. span iv. start and end point b) Maya provides highly effective tools for all t

Lossy audio formats, Lossy Audio Formats: These are based on sound models ...

Lossy Audio Formats: These are based on sound models which eliminate audio data such humans cannot or can hardly hear, for example: a low volume sound after a large volume sound.

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