Skip to content

Latest commit

 

History

History
66 lines (51 loc) · 1.34 KB

File metadata and controls

66 lines (51 loc) · 1.34 KB

THREE.SolarSystem

A library for generating solar systems with THREE.js

Dependencies

THREE.GEO

https://github.com/scottbyrns/THREE.GEO-Geospatial-Mapping

Ussage

	
	var solarSystemData = {
	    "sun": {
	        "radius": 6.955,
	        "representation": {
	            "texture": "textures/sun.gif"
	        }
	    },
	    "planets": [{
	        "name": "Mercury",
	        "representation": {
	            "texture": "textures/Planets/mercurymap.jpg",
	            "bumpMap": "textures/Planets/mercurybump.jpg",
	            "textureOffset": -180.806168
	        },
	        "distance": 579.1,
	        "radius": 0.0244,
	        "rotationPeriod": {
	            "years": 0,
	            "days": 58,
	            "hours": 15,
	            "minutes": 30
	        },
	        "orbitalPeriod": {
	            "years": 0,
	            "days": 88,
	            "hours": 0,
	            "minutes": 0
	        },
	        "mass": 3.285e+23,
	        "coordinates": {
	            "phi": 212.7696388888889,
	            "lambda": 1.9079166666666665,
	            "radius": 648.928187987607
	        }
	    }
	};

	ourSolarSystem = new THREE.SolarSystem(solarSystemData, scene);
		
	function render() {

		ourSolarSystem.update();
		
		camera.lookAt( ourSolarSystem.star.position );
		renderer.render( scene, camera );

	}