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
Silicon Graphics - Hardware for computer animation The SGI platform is one of the most broadly used hardware platforms in professional or broadcast feature computer animation

Find out the matrix of projection for cavalier projection Answer: Cavalier projection corresponds to tan α = 1, leading to the following matrix.

explain vecgen line drawing algorithm

QUESTION (a) People want to know design patterns. i) What should their attitude be about design patterns? ii) How can people use design patterns to do a better job?

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

Parallel Projection In parallel projection, objects in scene are projected onto the 2D view plane along rays parallel to a projection vector. Parallel projection is orthogra

self test exercise 17 asked you to overload the operator >> and the operator Overload biinary operator + to add pairs according to the rule (a, b) + (c, d) = (a + c, b, + d) overl

Distinguish between parallel and perspective projection Parallel Projection Perspective projection Coordinate position are transformed

Perform the indicated base conversions 548 to base 5

Intersection Test - Visible Surface Detection Test: It called Intersection Test also: we go for intersection test, if Min-max test fails. Now we take each edge individually