Hi there,
I’m working on a project, involving video, svg and createdShape, displayed in 3 “sub-window” (actually 3 “rectangles” drawn in the main window canva) -the aim is to map it on 3 screen surfaces.
I’d like to use multiple SVG files, loaded in a PShape array (actually 3 PShape Array, one per subwindow).
For that my code look like that (I simplified it, as I have multiple tabs for different functionnalities, like OSC receiving, video, ect…):
PShape[] svgA = new PShape [1];
PShape[] svgB = new PShape [1];
PShape[] svgC = new PShape [1];
void setup(){
svgA[0] = loadShape("beetle.svg");
svgB[0] = loadShape("beetle.svg");
svgC[0] = loadShape("beetle.svg");
}
void draw(){
svgA();
svgB();
svgC();
}
void svgA(){
shape(svgA[0],centerWinAx,centerWinAy, 160,260);
}
void svgB(){
shape(svgB[0],centerWinBx, centerWinBy, 160,260);
}
void svgC(){
shape(svgC[0],centerWinCx, centerWinCy, 160,260);
}
But as I got this error:
ArrayIndexOutOfBoundsException: Index 662 out of bounds for length 662
I decided to come back to my first svg test code with a far more simple code :
PShape beetle;
void setup() {
size(640, 360);
beetle = loadShape("beetle.svg");
}
void draw(){
shape(beetle,40, 40, 320, 320);
}
But it gives me the very same error :
ArrayIndexOutOfBoundsException: Index 662 out of bounds for length 662
Which is very weird as there is no Array in this code.
So I’m lost with it and have absolutely no idea how to proceed to debug it…
(Of course, my simple svg test code is saved with the svg file in the data folder, and it used to work when I tried it the first time).
Thank you.