Inside GlobeTweeter

GlobeTweeter - Main Loop

SceneGraph - OSGJS

GlobeTweeter - Globe data

GlobeTweeter - Wave

GlobeTweeter - Tweets

Tweets Update

update: function(node, nv) {
    var ratio = 0, pcurrentTime = nv.getFrameStamp().getSimulationTime();
    if (node.startTime === undefined) { // It means we start the local timer
        node.startTime = currentTime;
        if (node.duration === undefined)
            node.duration = 5.0;
    }
    var dt = currentTime - node.startTime;
    if (dt > node.duration) { // exceded duration, we hide it
        node.setNodeMask(0);
        return;
    }
    ratio = dt/node.duration; // give a ratio related to elapsed/duration
    if (node.originalMatrix) {
        var scale;
        if (dt > 1.0) // clamp to  after 1.0 sec
            scale = 1.0;
        else
            scale = osgAnimation.EaseOutElastic(dt); // get an elastic curve on scale

        // because we can zoom a lot we affect the scaling by another factor
        scale = scale * (this.manipulator.height/this.WGS_84_RADIUS_EQUATOR);
        if (this.manipulator.height > this.limit) { // magic number add a second factor
            var rr = 1.0 - (this.manipulator.height-this.limit) * 0.8/(2.5*this.WGS_84_RADIUS_EQUATOR-this.limit);
            scale *= rr;
        }
        node.setMatrix(osg.Matrix.mult(node.originalMatrix, osg.Matrix.makeScale(scale, scale, scale)));
    }

    var value = (1.0 - osgAnimation.EaseInQuad(ratio)); // fade out
    var uniform = node.uniform;
    var c = [value, value, value, value];
    uniform.set(c);
    node.traverse(nv);
}

Credits/Thanks


Code - Cedric Pinson @trigrou

Design - Guillaume Lecollinet @glecollinet

Hack js - Johan Euphrosine @proppy

DzSlides- Paul Rouget dzslides


Get GlobeTweeter on github

Test the demo or check the video

Display 3D model with ShowWebGL

http://plopbyte.com/insideglobetweeter/