var scene, renderer, camera;
var cube;
var controls;
init();
lightSetup();
animate();
function init() {
renderer = new THREE.WebGLRenderer({
antialias: true
});
renderer.localClippingEnabled = true;
var width = window.innerWidth;
var height = window.innerHeight;
renderer.setSize(width, height);
document.body.appendChild(renderer.domElement);
scene = new THREE.Scene();
var center = new THREE.Vector3(72, 0.625, -72);
var gridXZ = new THREE.GridHelper(1000, 100);
scene.add(gridXZ);
var axes = new THREE.AxesHelper(1000);
scene.add(axes);
camera = new THREE.PerspectiveCamera(45, width / height, 1, 10000);
camera.position.x = 76;
camera.position.y = 76;
camera.position.z = 76;
camera.lookAt(center);
camera.updateProjectionMatrix();
controls = new THREE.OrbitControls(camera, renderer.domElement);
var path = new THREE.Path();
const getAngle = (p1) => {
let result;
const p2 = new THREE.Vector3(1,0,0);
if(p1 && p2) {
const angle1 = Math.atan2(p1.y, p1.x);
const angle2 = Math.atan2(p2.y, p2.x);
result = (angle2 - angle1) * 180 / Math.PI;
} else {
throw new Error(`Cannot get angle: one (or both) vector(s) is null.`);
}
return result;
}
var points = [new THREE.Vector3(12.89258589142716, 92.37846242253646, 0),
new THREE.Vector3(15.20352860350063, 97.63054083690821, 0),
new THREE.Vector3(19.19515692435479, 103.72295179757943, 0),
new THREE.Vector3(23.186785245208966, 108.1346976656517, 0),
new THREE.Vector3(29.069184875941446, 114.64727489947266, 0),
new THREE.Vector3(32.850727495698024, 119.26910390411979, 0),
new THREE.Vector3(37.68269862094256, 124.31109918191667, 0),
new THREE.Vector3(41.88441264289432, 128.09259564026434, 0),
new THREE.Vector3(46.29621236594367, 130.82367641573762, 0),
new THREE.Vector3(52.59878339887132, 133.7648403277858, 0),
new THREE.Vector3(59.531611535091734, 134.60517287408527, 0),
new THREE.Vector3(66.04426826911697,...
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.