spin the earth for fun

This commit is contained in:
James B. Pollack 2015-12-05 17:43:13 -08:00
parent 906540272e
commit 7859241ad3

View file

@ -185,6 +185,7 @@ function cleanupMarkers() {
function cleanupEarth() {
Entities.deleteEntity(earth);
Script.update.disconnect(spinEarth);
}
function cleanupInterval() {
@ -196,7 +197,7 @@ function cleanupInterval() {
Script.scriptEnding.connect(cleanupMarkers);
Script.scriptEnding.connect(cleanupEarth);
Script.scriptEnding.connect(cleanupInterval);
//first draw
getThenProcessQuakes();
var pollingInterval = null;
@ -206,4 +207,17 @@ if (POLL_FOR_CHANGES === true) {
cleanupMarkers();
getThenProcessQuakes()
}, CHECK_QUAKE_FREQUENCY)
}
}
function spinEarth(){
Entities.editEntity(earth,{
angularVelocity:{
x:0,
y:0.5,
z:0
}
})
}
Script.update.connect(spinEarth)