Difference between revisions of "Test"

From 2628Climator
Jump to: navigation, search
Line 22: Line 22:
 
<area shape="poly" alt="Group 7" title="Group 7" coords="658,84,645,66,594,51,594,42,637,24,672,20,708,25,731,32,749,75,734,114,681,154,657,142,649,112" href="http://2628climator.hyperbody.nl/index.php/project07:Frontpage">
 
<area shape="poly" alt="Group 7" title="Group 7" coords="658,84,645,66,594,51,594,42,637,24,672,20,708,25,731,32,749,75,734,114,681,154,657,142,649,112" href="http://2628climator.hyperbody.nl/index.php/project07:Frontpage">
 
</map>
 
</map>
</html>
 
 
<html>
 
<body>
 
<script>
 
var flakes = [],
 
    bodyHeight = getDocHeight(),
 
    bodyWidth = document.body.offsetWidth;
 
 
 
function snow() {
 
    for (var i = 0; i < 50; i++) {
 
        var flake = flakes[i];
 
 
        flake.y += flake.velY;
 
 
        if (flake.y > bodyHeight - (flake.size + 6)) {
 
            flake.y = 0;
 
        }
 
 
        flake.el.style.top = flake.y + 'px';
 
        flake.el.style.left = ~~flake.x + 'px';
 
 
        flake.step += flake.stepSize;
 
        flake.velX = Math.cos(flake.step);
 
 
        flake.x += flake.velX;
 
 
        if (flake.x > bodyWidth - 40 || flake.x < 30) {
 
            flake.y = 0;
 
        }
 
    }
 
    setTimeout(snow, 10);
 
};
 
 
 
function init() {
 
    var docFrag = document.createDocumentFragment();
 
    for (var i = 0; i < 50; i++) {
 
        var flake = document.createElement("div"),
 
            x = Math.floor(Math.random() * bodyWidth),
 
            y = Math.floor(Math.random() * bodyHeight),
 
            size = (Math.random() * 5) + 2,
 
            speed = (Math.random() * 1) + 0.5;
 
 
        flake.style.width = size + 'px';
 
        flake.style.height = size + 'px';
 
        flake.style.background = "#fff";
 
 
        flake.style.left = x + 'px';
 
        flake.style.top = y;
 
        flake.classList.add("flake");
 
 
        flakes.push({
 
            el: flake,
 
            speed: speed,
 
            velY: speed,
 
            velX: 0,
 
            x: x,
 
            y: y,
 
            size: 2,
 
            stepSize: (Math.random() * 5) / 100,
 
            step: 0
 
        });
 
        docFrag.appendChild(flake);
 
    }
 
 
    document.body.appendChild(docFrag);
 
    snow();
 
};
 
 
document.addEventListener("mousemove", function(e) {
 
    var x = e.clientX,
 
        y = e.clientY,
 
        minDist = 150;
 
 
    for (var i = 0; i < flakes.length; i++) {
 
        var x2 = flakes[i].x,
 
            y2 = flakes[i].y;
 
 
        var dist = Math.sqrt((x2 - x) * (x2 - x) + (y2 - y) * (y2 - y));
 
 
        if (dist < minDist) {
 
            rad = Math.atan2(y2, x2), angle = rad / Math.PI * 180;
 
 
            flakes[i].velX = (x2 / dist) * 0.2;
 
            flakes[i].velY = (y2 / dist) * 0.2;
 
 
            flakes[i].x += flakes[i].velX;
 
            flakes[i].y += flakes[i].velY;
 
        } else {
 
            flakes[i].velY *= 0.9;
 
            flakes[i].velX
 
            if (flakes[i].velY <= flakes[i].speed) {
 
                flakes[i].velY = flakes[i].speed;
 
            }
 
        }
 
    }
 
});
 
 
init();
 
 
function getDocHeight() {
 
    return Math.max(
 
    Math.max(document.body.scrollHeight, document.documentElement.scrollHeight), Math.max(document.body.offsetHeight, document.documentElement.offsetHeight), Math.max(document.body.clientHeight, document.documentElement.clientHeight));
 
}​
 
</script>
 
</body>
 
 
</html>
 
</html>

Revision as of 23:40, 25 December 2013

Media Studies course introduction and first lecture with Mark Hemel take place
on Monday, 9th September, 9:45 in room C !

for your reference, Marc Hemel is founding partner of Information Based Architecture and has designed among others the world's
tallest TV tower (610 meter) in Guangzhou, China.



Hyperbody students are welcome to attend eCAADe presentations in protoSPACE!


Wednesday 18 Sep: 11:00 Crowdsourcing and Sensing; 14:00 Performative and Interactive Architecture; 16:30 Algorithmic Design Generation
Thursday 19 Sep: 10:30 Digital Fabrication; 14:00 Models of Computation: Form Studies; 16:15 Biomimetics and Bio-Inspiration
Friday 20 Sep: 11:00 Material Studies; 14:00 Performative Design

Site map eco.FAB Group 2 Group 3 e-CENTER BiTE Group 6 Group 7