Skip to content

Animation of a water ripple effect over a selectable image using Qt Widgets

Notifications You must be signed in to change notification settings

sfadiga/WaterRipple

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Water Ripple

Animation of a water ripple effect over a selectable image using Qt Widgets

The idea and some of the code were copied from: http://agilerepose.weebly.com/water-ripple.html

Example of the application:

the idea behind this code is to update a pixel table from the original image making the origin of the efect in (x,y) to propagate changes on the pixels in 4 directions, basically a loop updates the frame buffer using the following pseudo-code:


damping = some non-integer between 0 and 1

  begin loop 
      for every non-edge element:
      loop
          Buffer2(x, y) = (Buffer1(x-1,y)
                           Buffer1(x+1,y)
                           Buffer1(x,y+1)
                           Buffer1(x,y-1)) / 2 - Buffer2(x,y)
 
          Buffer2(x,y) = Buffer2(x,y) * damping
      end loop

      Display Buffer2
      Swap the buffers 

  end loop

the original idea is well explained here: https://web.archive.org/web/20160418004149/http://freespace.virgin.net/hugo.elias/graphics/x_water.htm

About

Animation of a water ripple effect over a selectable image using Qt Widgets

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published