Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Mar 2005
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    accelerated scrolling function

    as you may know, i am programming an image scroller which scroll through a set of images and stops after each one.

    now i'm looking for an appropriate scrolling acceleration function. i'd like that the images first move quite fast and then slows down till the end.

    i've experimented with sin(x)^2/x but it's very hard to find a well-looking function. are there any people around here who know some nice function for this?

    also: is it better to have 40 ms intervalls with 10 px steps or 20 ms intervalls with 5 px steps? which one looks smoother? i guess i'm addressing the experienced users of you...

    thx anyway

  • #2
    Regular Coder
    Join Date
    Aug 2004
    Location
    codegoboom@yahoo.com
    Posts
    999
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I wrote an unusual function for that sort of thing a while back...
    *this message will self destruct in n-seconds*

  • #3
    New Coder
    Join Date
    Mar 2005
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hehe nice stuff...

    i did mine like this: y = a*x*Math.pow(e, -1/b*x), whereas e = 2.7182..

    it runs quite smoothly

  • #4
    Regular Coder
    Join Date
    Aug 2004
    Location
    codegoboom@yahoo.com
    Posts
    999
    Thanks
    0
    Thanked 0 Times in 0 Posts
    nifty...
    btw, several others are given here: Robert Penner's Easing Equations
    Last edited by codegoboom; 03-07-2005 at 04:16 PM. Reason: -->
    *this message will self destruct in n-seconds*

  • #5
    Master Coder
    Join Date
    Feb 2003
    Location
    Umeå, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    drdre: 40 and 20 ms are both too low. Win9x provides a minimal guaranteed time frame of 55ms (WinNT provides a minimum frame of 10ms). Anything less than this will still be extended to 55ms or 10ms, respectively.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards


  •  

    Posting Permissions

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