if (!Detector.webgl) {
Detector.addGetWebGLMessage();
}
var renderer, scene, camera, controls, stats;
var plane, sphere, item;
var numberofobjects = 1000;
var objects = [];
var object = new THREE.Object3D();
var group = new THREE.Object3D();
var radius = 2;
var targetsRandom = [];
var targetsLinear = [];
var flutter = false;
var axes = [];
var opacities = [];
var count = 0;
var delta = 1;
function v(x, y, z) {
return new THREE.Vector3(x, y, z);
}
function gradientDirection(positionVector) {
var X = positionVector.x;
var Y = positionVector.y;
var Z = positionVector.z;
return v( 0.1*X, 0.1*Y, 1 ).add(positionVector);
// return v( 2*X, 2*Y, -2*Z ).add(positionVector);
}
function axisOfMovement() {
return v(0,0,1);}
init();
animate();
function init() {
if (!Detector.webgl) {
renderer = new THREE.CanvasRenderer({
antialias: true
});
} else {
renderer = new THREE.WebGLRenderer({
antialias: true
});
}
var geometry, material, mesh, info;
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);
scene = new THREE.Scene();
camera = new THREE.PerspectiveCamera(40, window.innerWidth / window.innerHeight, 1, 1000);
camera.position.set(-100, 100, 100);
controls = new THREE.TrackballControls(camera, renderer.domElement);
stats = new Stats();
stats.domElement.style.cssText = 'position: absolute; top: 0px; zIndex: 100; ';
document.body.appendChild( stats.domElement );
var css = document.body.appendChild(document.createElement('style'));
css.innerHTML = 'body {font: 600 12pt monospace; margin: 0; overflow: hidden; text-align: center; }';
// create the 'symbol' and add to array of symbols
var geometryTorus = new THREE.TorusGeometry(radius, 0.25, 15, 30);
var geometryCircle = new...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.