CanvasMap
Getting Started Tutorials 3D Reference

Backgrounds

CanvasMap supports the THREE.CubeTextureLoader which will load 6 rectangular images to display a background for a scene.

Below is the code to add a cube background texture to a CanvasMap 3D scene. Note that the path to a folder is specified. The folder then contains the six sides of a cube that are to be displayed. The order the of the files in the load function indicate which face of the cube the file is for. px refers to the face in the positive x direction while nx refers to the face in the negative x direction and so on.

 var TextureLoader = new THREE.CubeTextureLoader();
 TextureLoader.setPath( 'https://gsp.humboldt.edu/Archive/Images/2019/3DBackgrounds/Milkyway/' )
 var TheTexture =TextureLoader.load( [ 'dark-s_px.jpg', 'dark-s_nx.jpg', 'dark-s_py.jpg', 'dark-s_ny.jpg', 'dark-s_pz.jpg', 'dark-s_nz.jpg' ] );
 
 TheScene.SetBackground(TheTexture);