if (q[i][j] != 0) {
double dx = i - (width - 1) * 0.5;
double dy = j - (height - 1) * 0.5;
double r = Math.sqrt(dx * dx + dy * dy) / maxR + MathLib.EPSILON;
double size = minSize + (maxSize - minSize) * r;
Torus sphere = new Torus();
sphere.getPosition().setValue(dx * gridSize + xOffset, dy * gridSize + yOffset, zOffset);
sphere.getSize().setValue(size);
sphere.getRotate().setValue(90 + Math.random() * 12.0 - 6.0, Math.random() * 12.0 - 6.0, Math.random() * 12.0 - 6.0);
pScene.addObject(sphere);
}
}
}