Click to See Complete Forum and Search --> : Ripples
Allanon
Feb 19th, 2001, 10:41 AM
Does anybody know how I can make my bitmap (which looks like water) ripple. Sort of like how GT Ripple makes the desktop ripple.
THANKS
plenderj
Feb 19th, 2001, 10:55 AM
Well, correct me if I'm wrong, but a ripple could be faked by zooming/enlarging the pixels in certain areas/shapes.
Specifically, you would enlarge the pixels in the thick outline of a cirle. Then another circle, and another and another etc. working their way in/out getting smaller/bigger.
That should look like a ripple :)
- jamie
kedaman
Feb 19th, 2001, 11:19 AM
Ripples actually look that way because of the wave form they have in z-perspective. If your looking for this approach, you won't see anything if z perspective isn't involved, therefore you have to use 3d perspective, and furthermore isometric, otherways you will get wrong outcome dimensions for a bitmap. Leting Z axis go with a component in Y and X would look realistic. Now picking the Z component should be done with sin() for a wave form depending on the distance to the center. So Z component would be
sin(frequency*sqr(dx*dx+dy*dy))
where frequency is the wave frequency in radians per pixel. dx and dy are distance to center in resp. components.
Mad Compie
Feb 20th, 2001, 01:51 PM
The attached VBRIPPLE.ZIP contains source code for this nipple effect. I mean ripple effect.
plenderj
Feb 21st, 2001, 02:14 AM
Very impressive.
- jamie
Mad Compie
Feb 21st, 2001, 01:46 PM
...and also very fast, thanks to the CopyMemory API.
Remark that only 256 colours bitmaps are supported with this algorithm.
kedaman
Feb 21st, 2001, 02:15 PM
oh you got that from ur.co.nz right?
Mad Compie
Feb 22nd, 2001, 01:55 PM
I don't remember it, Keda!
Anyway, here are two more demo projects using the CopyMemory API:
VBFlamer and VBurbump.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.