3D Pool in C++