



////////////////////// General stuff //////////////////////





// jquery var counter
$({meineVar:1}).animate({meineVar:0},{
  step: function(){
  }
})






// random color by Christoph http://stackoverflow.com/users/1047823/christoph
function get_random_color() {
    var letters = '0123456789ABCDEF'.split('');
    var color = '#';
    for (var i = 0; i < 6; i++ ) {
        color += letters[Math.round(Math.random() * 15)];
    }
    return color;
}
















///////////// ThreeJs Snippets



// resize viewport on window resize
window.onresize = function() {

  document.querySelectorAll("canvas")[0].width = container.offsetWidth;
  document.querySelectorAll("canvas")[0].height = container.offsetHeight;
  
  camera.aspect = container.offsetWidth / container.offsetHeight;
  camera.updateProjectionMatrix();
  renderer.setSize(container.offsetWidth, container.offsetHeight);
}







// add some light
var light = new THREE.DirectionalLight( 0xffffff, 1.5);
light.position.set(0, 1, 1);
scene.add( light );




// material for more complex visualization
new THREE.MeshLambertMaterial({ color: "#188AE7" });




// make material appear on both poly sides
material.side = THREE.DoubleSide;




// simple sphere
var sphere = new THREE.Mesh(new THREE.SphereGeometry(50, 0, 0), new THREE.MeshNormalMaterial());
scene.add(sphere);




// bitmap material
var img = new THREE.MeshBasicMaterial({
    map:THREE.ImageUtils.loadTexture("bitmap.jpg")
});
img.map.needsUpdate = true;




// some light
var light = new THREE.DirectionalLight( 0xffffff, 1.5);
light.position.set(0, 1, 1);
scene.add( light );




