Skip to content

Instantly share code, notes, and snippets.

@roundrobin
Forked from anonymous/_.md
Created September 11, 2012 19:22
Show Gist options
  • Save roundrobin/3701271 to your computer and use it in GitHub Desktop.
Save roundrobin/3701271 to your computer and use it in GitHub Desktop.
just another inlet to tributary
{"editor_editor":{"coffee":false,"vim":false,"emacs":false,"width":356,"height":601,"hide":false},"endpoint":"curiosity"}
var positionX = 12;
var positionY = 10;
var positionZ = 40;
var rows = 2;
var cols = 2;
var cubes = [];
var sp = new THREE.SphereGeometry();
for(var i = 0; i < 2; i++){
var materials = [];
var cube;
materials.push( new THREE.MeshBasicMaterial( { color: 0xffffaa * Math.random()} ) );
materials.push( new THREE.MeshBasicMaterial( { color: 0xaaffff * Math.random()} ) );
materials.push( new THREE.MeshBasicMaterial( { color: 0xaaffaa * Math.random()} ) );
materials.push( new THREE.MeshBasicMaterial( { color: 0xaaffaa * Math.random()} ) );
materials.push( new THREE.MeshBasicMaterial( { color: 0xaaffff * Math.random()} ) );
materials.push( new THREE.MeshBasicMaterial( { color: 0xaaffff * Math.random()} ) );
materials.push( new THREE.MeshBasicMaterial( { color: 0xaaffff * Math.random()} ) );
cube = new THREE.Mesh( new THREE.CubeGeometry( 100, 100, 100, 1, 1, 1, materials ), new THREE.MeshFaceMaterial() );
cube.position.y = positionY * (i+1.5);
if(i % rows == 0){
positionY += 100
}
if(positionY > 200){
positionY = 0
}
cube.position.x = positionX;
cube.position.z = positionZ;
tributary.scene.add( cube );
cubes.push(cube)
}
//console.log('sdf',tributary.render)
// console.log('Helloo',tributary.animate)
tributary.animate = function () {
requestAnimationFrame( tributary.animate );
tributary.render();
stats.update();
for(var i = 0; i < cubes.length; i++){
cubes[i].rotation.x += 0.01;
cube.rotation.y += 0.02;
}
//cube.rotation.x += 0.01;
//cube.rotation.y += 0.02;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment