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
Mathematics: There are some area like Probability, combination, permutation, etc.,that can be well explained along with the help of animation, that helps in enhancing the learning

Computer Animation Tools  To create various types of animation discussed above, we want to have particular software and hardware as well. Here, the fundamental constraint is re

Orthographic and Oblique Projection - Viewing Transformation Orthographic projection is the easiest form of parallel projection that is commonly utilized for engineering drawi

2-DIMENSIONAL TRANSFORMATION Modeling transformation is the mechanism to compose an image from modeling  primitives. The modeling primitives are defined in their own coordinate

Delta-Delta Arrangement and In-Line Arrangement There are two types of shadow masks available, delta-delta arrangement and in-line arrangement. The in-line arrangement refers t

Question: Suppose we have a video monitor with a display area measuring 12.8 inches across and 9.6 inches high.  If the resolution is 1024 by 768 and the aspect ratio is 1, what is

Derive the common transformation of parallel projection into the xy-plane in the direction of projection d=aI+bJ+cK. Solution: The common transformation of parallel projection

Types of Light Resources - illumination Model Let us discuss about the types of light resources. The light sources can not merely be natural like light from Sun or Moon or Sta

Sound and Audio: Sound is a mechanical energy disturbance which propagates by matter as a wave. Sound is characterized through the various properties that are: frequency, per

Presentation Graphics The instant you are going to represent yourself or your product or company or research paper and so on. Only standing and speaking is fairly ineffective.