xxxxxxxxxx
var img;
var x = 0;
var y = 0;
function preload() {
//load csv file
table = loadTable("Data.csv", 'csv', 'header');
}
function setup() {
c = createCanvas(windowWidth, windowHeight);
background(0);
vid = createVideo("220427_Zeitraffer.mp4")
vid.size(windowWidth, windowHeight);
vid.play();
vid.loop();
vid.hide();
textSize(14);
filas = table.getRowCount();
lat = table.getColumn(1);
print(lat);
frameRate(20);
i = 0; //Zähler
//noLoop();
}
function draw() {
vid.loadPixels();
a = height
pixel0 = vid.get(vid.width / 2, a * 0.5);
lon = table.get(i, 0) //Wert latitude Stelle i
lat = table.get(i, 1) //Wert longitude, Stelle i
xl = map(lat, 11.77, 11.80, 0, windowHeight - 50);
yl = map(lon, 50.17, 50.20, windowHeight - 50, 0);
ele = table.get(i,2);
c = map(ele, 550, 650, 0, 255);
fill(pixel0); //Farbwert Video
//fill(ele) //Höhenmeter
noStroke();
ellipse(xl, yl, 10, 10);
i++;
fill(0)
}
function keyPressed() {
if (key == "s") {
save('visualization.png');
}
}