JSFiddle - React, Tailwind, and code Playground
HTML
<body>
<div id="WebGL-output"></div>
<body>
<script src="http://threejs.org/build/three.min.js"></script>
<script src="http://threejs.org/examples/js/controls/OrbitControls.js"></script>
JavaScript
$(document).ready(function()
{
var four, meshFour;
var renderer, camera, orbitControls, clock;
var scene = new THREE.Scene();
// once everything is loaded, we run our Three.js stuff.
function init() {
// create a scene, that will hold all our elements such as objects, cameras and lights.
// create a camera, which defines where we're looking at.
camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1000);
// position and point the camera to the center of the scene
camera.position.set( 20, 20, 20 );
camera.lookAt(new THREE.Vector3(0, 0, 0));
// create a render and set the size
renderer = new THREE.WebGLRenderer();
renderer.setClearColor( 0xEEEEEE, 1.0 );
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.shadowMapEnabled = true;
// create the ground plane
var planeGeometry = new THREE.PlaneGeometry(60, 40, 1, 1);
var planeMaterial = new THREE.MeshLambertMaterial({color: 0xff0000});
var plane = new THREE.Mesh(planeGeometry, planeMaterial);
plane.receiveShadow = true;
// rotate and position the plane
plane.rotation.x = -0.5 * Math.PI;
plane.position.set( 0, 0, 0 );
scene.add(plane);
//FOUR - TETRAHEDRON
var loaderFour = new THREE.JSONLoader( true );
var materialsArray = [];
materialsArray.push(new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture("http://intelitrac.com/action-item-tracking.png")}));
materialsArray.push(new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture("http://intelitrac.com/Alerts.png")}));
materialsArray.push(new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture("http://intelitrac.com/Modules.png")}));
materialsArray.push(new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture("http://intelitrac.com/admin.png")}));
for(var i = 0; i <= 3; i++) {
materialsArray[i].map.minFilter = THREE.LinearFilter;
}
...