Projects - Canvas scenes - Solar system | ![]() |
Solar system objects in javascript.
Each object being able to turn around another object passed as a parameter.
Mercury, Venus, Earth, Moon, Mars, Jupiter, Saturn, Uranus, Neptune and Pluto revolve in elliptical orbit around the sun, the moon, for example being set to rotate around the earth.
Example with the moon object:
//------------------
// PARAMETRES LUNE
//------------------
var rapDisSolLune = 10, disLune = sole.W/2,
rapSolLune = 9;
tPla["lune"] = {
NOM: "Lune",
DIST: disLune,
X: tPla["terr"].X,
Y: tPla["terr"].Y-disLune,
RAD: 0,
W: sole.W/rapDisSolLune,
COL: "#e4e4e4",
COLIGHT : hextoCanCol("#e4e4e4", opaTraj),
VIS: false,
RAPSOL: rapSolLune,
RAPDISOL:0.7,
VITESSE: 0.11,
DECALFROMRAD : 3.9
}
function clearCanvas(){
var indice = (opt_trne) ? 0.4 : 1;
ctx.fillStyle = "rgba(29,29,29,"+ indice +")";
ctx.fillRect(0, 0, oCanvas.W, oCanvas.H);
}
Hoster: SOCIETE OVH
Head office: 2 rue Kellermann 59100 Roubaix - France.
Phone: +338 203 203 63
contact@anotherscript.com