Results 1 to 8 of 8

Thread: Ripples

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 1999
    Posts
    89
    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

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    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
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  3. #3
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    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.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  4. #4
    Fanatic Member Mad Compie's Avatar
    Join Date
    Aug 2000
    Location
    Kuurne (Belgium)
    Posts
    553
    The attached VBRIPPLE.ZIP contains source code for this nipple effect. I mean ripple effect.
    Attached Files Attached Files

  5. #5
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Very impressive.

    - jamie
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  6. #6
    Fanatic Member Mad Compie's Avatar
    Join Date
    Aug 2000
    Location
    Kuurne (Belgium)
    Posts
    553
    ...and also very fast, thanks to the CopyMemory API.
    Remark that only 256 colours bitmaps are supported with this algorithm.

  7. #7
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    oh you got that from ur.co.nz right?
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  8. #8
    Fanatic Member Mad Compie's Avatar
    Join Date
    Aug 2000
    Location
    Kuurne (Belgium)
    Posts
    553
    I don't remember it, Keda!
    Anyway, here are two more demo projects using the CopyMemory API:
    VBFlamer and VBurbump.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width