i draw some boxes with:
for (int i = 0; i < sources.size(); i++) {
int revisions = sources.elementAt(i).getNumberOfRevisions();
float x = BOX_X + (sources.elementAt(i).getNumberOfDeletedLines() * factorDeletedLines);
float z = BOX_Z + (sources.elementAt(i).getNumberOfAddedLines() * factorAddedLines);
float yposition = 0;
for (int j = 0; j < revisions; j++) {
float y = calculateBoxStep(i,j);
yposition = yposition + y;
Box source1 = new Box((Integer.toString(i).concat("-").concat(Integer.toString(j))), new Vector3f(x,yposition,z), BOX_X, y, BOX_Z);
source1.setModelBound(new BoundingBox());
source1.updateModelBound();
source1.setRenderState(ms);
boxesContainer.add(j, source1);
private float calculateBoxStep(int i, int j) {
if (j < (sources.elementAt(i).getNumberOfRevisions()-1)) {
Date date1 = sources.elementAt(i).getDate(j);
Date date2 = sources.elementAt(i).getDate(j+1);
float hours1 = date1.getTime();
float hours2 = date2.getTime();
float result = ((hours2 - hours1) / 1000 / 60 / 60 / 24 / 31) * BOX_STEP_TIME;
System.out.println(result);
return result;
} else {
return BOX_STEP;
}
}
but unfortunately the boxes are flickering. i think it is because the overlap each other... but why that? i cant find the fault in my algorithm. even if i'm quite sure that it has to be in the yposition argument :(