if (!Detector.webgl) {
Detector.addGetWebGLMessage();
}
var renderer, scene, camera, controls;
var plane, sphere, item;
var symbols = [];
var symbol = new THREE.Object3D();
var group = new THREE.Object3D();
var normaldirection = new THREE.Vector3();
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);
var css = document.body.appendChild(document.createElement('style'));
css.innerHTML = 'body {font: 600 12pt monospace; margin: 0; overflow: hidden; text-align: center; }';
// set background color to black
renderer.setClearColorHex(0x000000, 1);
// add stuff that provides a visual frame of reference
material = new THREE.MeshBasicMaterial({
color: Math.random() * 0xffffff,
side: THREE.DoubleSide
});
// create the 'symbol' and add to array of symbols
geometryTorus = new THREE.TorusGeometry(4, 0.25, 15, 30);
materialTorus = new THREE.MeshBasicMaterial({
color: 0x000000
});
geometryCircle = new THREE.CircleGeometry(4);
materialCircle1 = new THREE.MeshBasicMaterial({
color: 0x00ffff,
opacity: 0.4,
side: THREE.FrontSide,
transparent: true
});
materialCircle2 = new THREE.MeshBasicMaterial({
color: 0xffff00,
opacity: 0.4,
side: THREE.BackSide,
transparent: true
});
...
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.