How to cut a panoramic image into a cubemap

Good morning everyone, How to use code to cut a panoramic image into 6 cubemaps in Babylon, as shown in the following figure
Snipaste_2024-02-29_17-33-04

Do you mean you want to create a cubemap based on a panoramic picture?

This should help:

https://doc.babylonjs.com/toolsAndResources/assetLibraries/availableTextures#360-equirectangular-maps-for-photodome