Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
vin139
vin139's Profile
2
Posts
20
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
TGA export problems
[4 Replies]
13-Feb-2013 11:42 AM
Forum:
Programming Questions
Hi!
I'm trying to export TGA files by simply having this at the end of the draw() loop:
saveFrame("output/seq-#######.tga");
Unfortunately all of the exported files have glitches. Is this a know issue?
It is not possible for me to export tiff or jpg because it would require way to much disk space...
Animation points from array
[32 Replies]
07-Feb-2013 04:08 AM
Forum:
Programming Questions
Hi!
I have a question about animating points from an array.
Somehow I can't figure out how to make this work.
Please see below an excerpt from my code.
I have a csv file with the data. It's is parsed in the class placesIveBeenV (see code at the bottom).
In setup() the csv is loaded and in draw() the dots + lines are drawn.
But how can I animate these dots + connecting lines?
I tried a couple of different things but nothing works.
Any help is greatly appreciated!
Thanks!
void setup() {
size(580, 800);
smooth();
noStroke();
// VIN
String[] NYlocationsV = loadStrings("openpaths.csv");
locationsV = new placesIveBeenV[NYlocationsV.length];
for (int i = 0; i < NYlocationsV.length; i++) {
locationsV[i] = new placesIveBeenV(NYlocationsV[i]);
}
}
void draw() {
if (savePDF) {
beginRecord(PDF, "NYmap"+y+"."+M+"."+d+"-"+hr+"."+m+"."+sec+".pdf");
}
background(245, 245, 245);
// DRAWING VIN
for (int i = 5; i < locationsV.length -1; i++) {
noStroke();
fill(vin);
ellipse(locationsV[i].x, locationsV[i].y, dotSize, dotSize); // DOTS
stroke(vin);
strokeWeight(routeLine);
line(locationsV[i].x, locationsV[i].y, locationsV[i+1].x, locationsV[i+1].y);
}
}
//and the class:
class placesIveBeenV {
float x, y;
float X, Y, Z;
String lat; // y
String lon; // x
placesIveBeenV(String s) {
int pos = s.indexOf(',');
lat = s.substring(0, pos);// LAT
s = s.substring(pos+1);
pos = s.indexOf(',');
lon = s.substring(0, pos);// LON
s = s.substring(pos+1);
pos = s.indexOf(',');
String al = s.substring(0, pos);// ALT
String date = s.substring(pos+1);// DATE
X = float(lon);
Y = float(lat);
Z = int(al);
x = map(X, -73.891000, -74.035000, width,0);// MIN, MAX, MAX, MIN
y = map(Y, 40.660000, 40.810000, height,0); // MIN, MAX, MAX, MIN
}
}
«Prev
Next »
Moderate user : vin139
Forum