Blog | DIM3

Monday, October 02, 2006

Inspiration

A couple of websites that are worth the look. Keep in mind though, most of these sites require Flash 8. This should definitely be a factor to keep in mind when designing our site.



  • Jen Sheroky click here
  • Shane Fleming click here
  • Stoav click here
  • Adobe Experience click here

  • 3G work...

    All work made for first assignment (3G website) can be found here: 3G Technology.

    Sunday, October 01, 2006

    Springs: Elasticity

    The physics behind it:

    We will take the example of a mass attached to a spring. Let's say that the normal state of the system, that is to say when nothing moves, in other words the equilibrium, happens when the spring has a length l. If you move the mass by dx, making so that the spring has now a length l', the force will then be

    -k.dx = -k(l'-l)
    k is a specific to each spring, and it is <1

    All this to show you what you already know : the more we pull on the spring, the faster it will go. Here, pulling hard means big dx, hence a big force, and a high speed.

    But we must not forget about inertia. The mass always tends to go back to equilibrium, but it has a certain speed when it does, so it doesn't just stop there.

    The ActionScript code:
    This code goes inside the Actions panel of the mass, which has to be a movie clip.

    onClipEvent (load) {
    // inertia relates to the quantity of energy that
    // the spring will carry
    // inertia = 1 would mean that the spring doesn't
    // loose any energy, and that it will oscillate
    // forever
    inertia = 0.9 ;

    // k relates to the spring, and how "hard" it will be.
    // The higher k the faster the mass will come back.
    k = 0.1 ;
    }

    onClipEvent (enterFrame) {

    // We calculate the distance to the mouse
    x = -this._x + _root._xmouse ;
    y = -this._y + _root._ymouse ;

    //We calculate the amount by which the mass will to move
    xp = xp * inertia + x*k ;
    yp = yp * inertia + y*k ;

    //We move it
    _x += xp ;
    _y += yp ;
    }


    For further information, click here.

    Gravitation

    Force = mass * g
    g is a constant equal to 10 meters per second per second (m/s2)

    acceleration = g

    speed = g * t + starting_speed
    t is the time elapsed since the beginning of the free fall


    FLASH
    onClipEvent (load) {
    gravity = 2 ;

    // This sets the _y position of the floor
    floor = 500 ;

    // Bounce is a number < 1 but close to 1
    // The closer to 1, the higher the ball will bounce
    bounce = 0.92 ;

    // We set the speed of the ball when it is released.
    speedx = 0 ;
    speedy = 0 ;
    }

    onClipEvent (enterFrame) {

    speedy = speedy + gravity ;

    this._x += speedx/5 ;
    this._y += speedy/5 ;

    // If we are beyond the floor, invert the speed
    if (this._y > floor) {
    this._y = floor ;
    speedy *= -bounce ;
    }
    }