introduced fixes to _write_opengl_input to place all particles in the box