I want to add a skybox to my Forge scene, but Forge is different from three.js. I want to know what I can do for it.
I have tried new THREE.CubeTextureLoader
, but the three.js in Forge doesn't have this function. Then I tried to build a CubeGeometry
, but it did't work well.
This is my code:
var materialArr=[];
var directions = ["aa_RT","aa_LF","aa_UP","aa_DN","aa_FR","aa_BK"] ;
for (var i = 0; i < 6; i++){
materialArray.push( new THREE.MeshBasicMaterial({
map: THREE.ImageUtils.loadTexture( "lib/img/aa/"+ directions[i] + ".jpg" ),
side: THREE.BackSide
}));
}
var skyBoxGeom = new THREE.CubeGeometry(80,80,80);
var skyBoxMaterial = new THREE.MeshFaceMaterial(materialArr);
var skyBox = new THREE.Mesh(skyBoxGeom,skyBoxMaterial);
viewer.impl.scene.add(skyBox);
This is my scene: