Today's micro- and nano-fabrication is essentially two-dimensional, with very limited possibilities of accessing the third dimension. The most viable way to mass-fabricate functional structures at the nano-scale, such as electronics or MEMS, with equal feature sizes in all directions, is by three-dimensional self-assembly. Up to now, three-dimensional self-assembly has mainly been restricted to crystals of polymer spheres. We report on two- and three-dimensional self-assembly of silicon cubes, levitated in a paramagnetic fluid. We demonstrate the benefits of templating and study the effect of a change in hydrophilicity of the cubes. These experiments bring us one step closer to three-dimensional self-assembly of anisotropic, semiconducting units, which is a crucial milestone in overcoming the scaling limits imposed by contemporary 2D microfabrication.