We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I can not get the svg's that I created to scale. Does anyone have any suggestions on how to fix this? Here is my code:
PShape Germany;
PShape Norway;
PShape SovietUnion;
PShape Austria;
PShape UnitedStates;
PShape[] countries;
int numCountries;
Table countryData;
void setup() {
size(1000, 500);
Germany = loadShape("Germany.svg");
Norway = loadShape("Norway.svg");
SovietUnion = loadShape("Soviet Union.svg");
Austria = loadShape("Austria.svg");
UnitedStates = loadShape("United States.svg");
countryData = loadTable("medals.csv", "header");
parseFlags();
noStroke();
smooth();
noLoop();
}
void draw() {
background(200);
parseTable();
}
void parseTable() {
for (TableRow row: countryData.rows()) {
String country = row.getString("Country");
float number = row.getFloat("Total");
int num = myIndex(country);
pushMatrix();
shape(SovietUnion, 600, 600);
scale(1.1);
shape(Austria, 70, 70);
scale(1.1);
shape(Germany, 800, 800);
scale(1.2);
shape(UnitedStates,900,90);
scale(1.4);
shape(Norway,1000,100);
scale(1.7);
popMatrix();
}
}
int myIndex(String icountryCode) {
println("I want to find: " + icountryCode);
int position = 0;
return position;
}
void parseFlags() {
numCountries = Germany.getChildCount();
numCountries = Norway.getChildCount();
numCountries = UnitedStates.getChildCount();
numCountries = SovietUnion.getChildCount();
numCountries = Austria.getChildCount();
countries = new PShape[numCountries];
}
Answers
Some random remarks: