public void render(LinkedList<VoxelGrid> voxels, LinkedList<Entity> entities) {
		int x = view.x;
		int y = view.y;
		int width = view.width;
		int height = view.height;

		Graphics2D g = (Graphics2D) buffer.getGraphics();

		/* erase the image */
		g.setColor(BACKGROUND);
		g.fillRect(0, 0, width, height);

		/* draw world */
		double min = 9999999;
		double max = -9999999;
		for (VoxelGrid voxel : voxels) {
			double[] minmax = voxel.getMinMax(view);
			if (minmax[0] < min)
				min = minmax[0];
			if (minmax[1] > max)
				max = minmax[1];
		}
		for (VoxelGrid voxel : voxels) {
			voxel.draw(g, view, min, max);
		}

		/* render each entity */
		for (Entity entity : entities) {
			if (view.contains(entity.point)) {
				entity.draw(g, -x, -y);
			}
		}

		/* draw selection rectangle */
		if (drawRect != null) {
			g.setColor(Color.gray);
			g.drawRect((int) drawRect.getX(), (int) drawRect.getY(),
					(int) drawRect.getWidth(), (int) drawRect.getHeight());
		}

		getGraphics().drawImage(buffer, 0, 0, width, height, null);

		g.dispose();

	}