JSFiddle - React, Tailwind, and code Playground
by realhunts
HTML
<script src="http://threejs.org/build/three.min.js"></script>
<script src="http://threejs.org/examples/js/controls/OrbitControls.js"></script>
JavaScript
// a basic three.js scene
var container, renderer, scene, camera, controls;
init();
function init() {
// scene
scene = new THREE.Scene();
// mesh
var sphereGeometry = new THREE.SphereGeometry(100, 32, 16);
var sphereMaterial = new THREE.MeshLambertMaterial({
color: 0xff0000
});
var sphere = new THREE.Mesh(sphereGeometry, sphereMaterial);
sphere.position.y = 100;
scene.add(sphere);
console.log(sphere.position)
}