I am currently experiencing some difficulties with an array index out of bounds exception.
Here are the lines that bug:
if (TableauTampon[0]==0 && TableauTampon[1]==0){
TableauTampon[0]=42;
}
It could happen that
TableauTampon[1] does not exist. In this case there is an exception which is thrown. However in the other case (when TableauTampon[1] exist) this test is crucial so I can't just just dropt it.
So the idea I had was to code a try / catch like this:
try {
if (TableauTampon[0]==0 && TableauTampon[1]==0){ // On passe l'une des deux valeurs à 1042 ...
TableauTampon[0]=1042;
}
}catch (IOException e) {
e.printStackTrace();
}
But the compiler tell me that it can't reach catch block for IO exceptions.
I am currently develloping an image processing project. More precisely I use the delaunay triangulation which draw triangles on an image which has been previously uploaded by the user (in the code it's a PImage).
After the triangulation step I manage to extract the coordinates oh each triangles individually. My question is: how to recreate individually each triangles with the background of the Pimage ?
As a drawing is often easier to understand than a long explanation there is a recap in picture.
1- The PImage background
2- The mesh after the delaunay triangulation (which is actually a layer above the image)
3- What I expect: explode each triangle individually.