xxxxxxxxxx
let iss;
let radius = 6371; // earth
let index = 0;
let length = 50;
let url = "https://docs.google.com/spreadsheets/d/e/2PACX-1vSIM167_je2p3GErLLW3_M-MIQI3DpslVtp0SFC1bBi4wu0FEVJ46AcBVt1TvJwjkOQLHPqtZRIVv4r/pub?gid=47366902&single=true&output=csv";
function preload() {
iss = loadTable(url, 'csv', 'header');
}
function setup() {
createCanvas(windowWidth, windowHeight, WEBGL);
createEasyCam();
//noLoop();
}
function draw() {
background(0,0,0);
let rows = iss.getRows();
// iss path animated
noFill();
stroke(255, 10, 500);
strokeWeight(500);
beginShape();
for (let r = 0; r < index; r++) { //rows.length
//print(rows[r]);
let x = iss.getNum(r, "x");
let y = iss.getNum(r, "y");
let z = iss.getNum(r, "z");
vertex(x/100, y/100, z/100);
}
endShape();
if (index < rows.length)
index ++;
else
index == 0;
/*
//iss path animated part
noFill();
stroke(255, 0, 100);
beginShape();
for (let r = index; r < index+length; r++) { //rows.length
//print(rows[r]);
let x = iss.getNum(r, "x");
let y = iss.getNum(r, "y");
let z = iss.getNum(r, "z");
vertex(x/100, y/100, z/100);
}
endShape();
if (index < rows.length)
index ++;
else
index == 0;
*/
/*
// iss path static
noFill();
stroke(255, 0, 100);
beginShape();
for (let r = 0; r < 400; r++) { //rows.length
//print(rows[r]);
let x = iss.getNum(r, "x");
let y = iss.getNum(r, "y");
let z = iss.getNum(r, "z");
vertex(x/100, y/100, z/100);
}
endShape();
*/
// earth
fill(255, 10);
stroke(255, 10);
//sphere(radius/100);
}