Here is the code snippet I am working on:
var camera, scene, renderer;
var mesh;
var x, y, z;
function init() {
"use strict";
renderer = new THREE.WebGLRenderer();
renderer.setPixelRatio(window.devicePixelRatio);
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);
camera = new THREE.PerspectiveCamera(70, window.innerWidth / window.innerHeight, 1, 100);
camera.position.z = 400;
scene = new THREE.scene();
function createplanet() {
var colorget, geometry;
function randomcolor() {
var letters, color, i;
color = '#';
letters = '0123456789ABCDEF'.split('');
i = 1;
if (i === true) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
}
geometry = new window.THREE.SphereGeometry(x, y, z);
x = Math.random() * 3;
y = Math.random() * 10;
z = y;
colorget = new window.THREE.LineBasicMaterial({color: randomcolor()
});
}
}
init();
animate();
Note: An 'animate' function will be added later.
I am facing an issue where the live preview feature in Brackets is not displaying anything, possibly due to THREE.something not being recognized. I have downloaded three.js, so should I use a JSON file or another approach? Any insight or help on this matter would be greatly appreciated.