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

Consider shiny surface with diffused reflection coefficient, Consider a Shi...

Consider a Shiny Surface Along With Diffused Reflection coefficient Consider a shiny surface along with diffused reflection coefficient of 0.8 and ambient reflection coeffici

Voltage or electro-magnetic field tablet and pointer, (a)  Voltage or Elect...

(a)  Voltage or Electro-Magnetic Field Tablet and Pointer: This has a grid of wires, embedded in the tablet surface along with various voltages or magnetic fields consequent to va

Implement the boundary fill and flood fill algorithm, 1. Implement the boun...

1. Implement the boundary fill algorithm and flood fill algorithm in C-language and use your code to fill two different types of closed areas such as  i)  A Circle ii)  A sel

Fixed point scaling, what is fixed point scaling? how composit transformati...

what is fixed point scaling? how composit transformation techniques works on it

Modelling and rendering a surface, Modelling and Rendering a surface Com...

Modelling and Rendering a surface Common practice in modelling and rendering a surface is to approximate it by a polygonal surface.  By a polygonal surface we mean a surface whi

Objects - polygon rendering and ray tracing methods, Objects - polygon rend...

Objects - polygon rendering and ray tracing methods Objects could be any state of material as solid, liquid. Gas and plasma. Though ray tracers can merely assist objects whic

Computer animation tools, Computer Animation Tools  To create various t...

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

Sound editing programs, Sound Editing Programs; Sound editing tools for bo...

Sound Editing Programs; Sound editing tools for both digitized and MIDI sound; by that you see music and also hear it. Through drawing a representation of a sound in fine growths,

2-d viewing and clipping - raster graphics and clipping, 2-D Viewing and C...

2-D Viewing and Clipping - Raster Graphics and  Clipping In the previous two units of this block, we illustrated the basic elements of computer graphics, that is, the hardware

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