//
// Name: Sun from different planets
// Author: Alexander Wolf
// License: Public Domain
// Version: 2.0
// Description: Look at the Sun from big planets of Solar System and Pluto.
//

var planets = new Array("Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune", "Pluto");
var atm = new Array(false, true, true, true, true, true, true, true, false);
var landscapes = new Array("moon", "moon", "garching", "mars", "saturn", "saturn", "saturn", "saturn", "moon");
var dates = new Array(2457728.645058,2457463.228403,2457381.978414,2457728.353391,2457728.289502,2453345.164502,2451887.227002,2451887.060336,2457426.060336);
var psizes = new Array("1°12′33″","0°44′25″","0°32′00″","0°19′19″","0°6′21″","0°3′18″","0°1′36″","0°1′4″","0°0′59″");

var atmosphere = LandscapeMgr.getFlagAtmosphere();
var fog = LandscapeMgr.getFlagFog();
var location = core.getObserverLocation();

core.wait(1);
SolarSystem.setFlagLabels(false);
LabelMgr.deleteAllLabels();
core.clear("natural");
core.setGuiVisible(false);
core.wait(3);
core.setTimeRate(0);

for (i=0; i<planets.length; i++)
{
	core.setObserverLocation(0, 0, 1, 5, "", planets[i]);
	core.setJDay(dates[i]);

	LandscapeMgr.setFlagAtmosphere(atm[i]);
	LandscapeMgr.setFlagFog(atm[i]);
	LandscapeMgr.setCurrentLandscapeID(landscapes[i]);

	core.selectObjectByName("Sun", false);

	var pname = LabelMgr.labelScreen("Sun from " + planets[i], 20, 20, false, 20, "#AA0000");
	var psize = LabelMgr.labelScreen("Angular size of Sun is " + psizes[i], 20, 50, false, 20, "#AA0000");
	LabelMgr.setLabelShow(pname, true);
	LabelMgr.setLabelShow(psize, true);

	StelMovementMgr.setFlagTracking(true);
	core.wait(3);
	StelMovementMgr.zoomTo(1.8, 1);
	core.wait(3);
	StelMovementMgr.zoomTo(120, 1);

	core.wait(5);
	LabelMgr.setLabelShow(pname, false);
	LabelMgr.setLabelShow(psize, false);
}

core.clear("natural");
core.setGuiVisible(true);
core.goHome();
