Skip to content

Instantly share code, notes, and snippets.

@enjalot
Created July 25, 2013 05:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enjalot/6077135 to your computer and use it in GitHub Desktop.
Save enjalot/6077135 to your computer and use it in GitHub Desktop.
Tributary inlet
{"description":"Tributary inlet","endpoint":"","display":"webgl","public":true,"require":[],"fileconfigs":{"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":true,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"editor_editor":{"coffee":false,"vim":false,"emacs":false,"width":347,"height":323,"hide":false}}
var positionX = 180;
var positionY = -90;
var positionZ = 50;
var rotationX = 12;
var rotationY = 50;
var rotationZ = 12;
var materials = [];
var cube;
/*
materials.push( new THREE.MeshBasicMaterial( { color: 0xffffaa } ) );
materials.push( new THREE.MeshBasicMaterial( { color: 0xaaffff } ) );
materials.push( new THREE.MeshBasicMaterial( { color: 0xaaffaa } ) );
materials.push( new THREE.MeshBasicMaterial( { color: 0xaaffaa } ) );
materials.push( new THREE.MeshBasicMaterial( { color: 0xaaffff } ) );
materials.push( new THREE.MeshBasicMaterial( { color: 0xaaffff } ) );
materials.push( new THREE.MeshBasicMaterial( { color: 0xaaffff } ) );
*/
cube = new THREE.Mesh( new THREE.CubeGeometry( 200, 200, 200, 1, 1, 1, 0), new THREE.MeshFaceMaterial( new THREE.MeshBasicMaterial( { color: 0xffffff, opacity: 1, wireframe: true } ) ) );
cube.position.y = positionX;
cube.position.x = positionY;
cube.position.z = positionZ;
cube.rotation.x = rotationX;
cube.rotation.y = rotationY;
cube.rotation.z = rotationZ;
tributary.scene.add( cube );
console.log('rotation',cube)
// Plane
plane = new THREE.Mesh( new THREE.PlaneGeometry( 721, 345 ), new THREE.MeshFaceMaterial( new THREE.MeshBasicMaterial( { color: 0xffffff, opacity: 1, wireframe: true } ) ));
plane.geometry.applyMatrix( new THREE.Matrix4().makeRotationX( - Math.PI / 2 ) );
tributary.scene.add( plane );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment