It depends on whether you use row or column order. Row-major is more typical in C / C ++, but you can do it if you do it manually.
, i, j, k'th, box.rect.height * box.rect.width * i, i th, box.rect.width * j, j - , k, k - . -:
const size_t n_x = box.rect.length;
const size_t n_y = box.rect.height;
const size_t n_z = box.rect.width;
working_lattice[1 * n_x * n_z + 5 * n_z + 3]
, , , -, .