You should be able to do basically the same thing in AE by using a camera projection technique detailed in Mark Christiansen’s fantastic book:
AE CS3: Professional Studio Techniques
https://www.amazon.com/Adobe-Effects-Professional-Studio-Techniques/dp/0321499786/ref=pd_bbs_sr_2?ie=UTF8&s=books&qid=1200640576&sr=8-2
Andrew Kramer also uses the technique in a couple of his tutorials:
https://www.videocopilot.net/tutorials.html?id=22
Just make sure you create your cube from white solids, accept shadows, don’t accept lights and build it in a pre-comp. Then drop that pre-comp in your projection comp, turn on collapse transformations and scale it on the Z-axis to extend the projection.
You’ll want to increase the Shadow Map Resolution (in Composition Settings > Advanced) to something high so the shadows don’t blur (also don’t use shadow diffusion).
Darby Edelen
Designer
Left Coast Digital
Santa Cruz, CA