CubMa

by Michael Prosser

HTML

<script src="https://scubanaut.io/js/babylon.js"></script>
<script src="https://scubanaut.io/js/babylon.js"></script>
<script src="https://scubanaut.io/js/babylon.js"></script>
<canvas id="renderCanvas" width="800" height="500"></canvas>

CSS

body{
  font-family: helvetica;
  
}

JavaScript

function generateSkyboxCube(scene,size){

  var material_0 = new BABYLON.StandardMaterial("cleanMaterial", scene);
  material_0.alpha = 1;
  material_0.diffuseColor = new BABYLON.Color3(0,0,0);
  material_0.specularColor = new BABYLON.Color3(0,0,0);
  material_0.emissiveColor = new BABYLON.Color3(0,0,0);
  material_0.ambientColor = new BABYLON.Color3(0,0,0);
  material_0.backFaceCulling = true;
  material_0.wireframe = false;
  material_0.emissiveTexture = new BABYLON.Texture("https://sleekinteractive.com/assets/skybox_all.jpg", scene);
  material_0.emissiveTexture.hasAlpha = false;
  material_0.emissiveTexture.uScale = 1;
  material_0.emissiveTexture.vScale = 1;

   
  var mesh_2 = new BABYLON.MeshBuilder.CreatePlane("PZ", { height: size, width: size }, scene);
  mesh_2.position = new BABYLON.Vector3(0,0,(size/2));
  mesh_2.rotation = new BABYLON.Vector3(0,0,0);
  mesh_2.scaling = new BABYLON.Vector3(1,1,1);
  mesh_2.isVisible = true;
  mesh_2.id = "PZ";
  var mesh_3 = new BABYLON.MeshBuilder.CreatePlane("NZ", { height: size, width: size }, scene);
  mesh_3.position = new BABYLON.Vector3(0,0,-(size/2));
  mesh_3.rotation = new BABYLON.Vector3(0,3.141592653589793,0);
  mesh_3.scaling = new BABYLON.Vector3(1,1,1);
  mesh_3.isVisible = true;
  mesh_3.id = "NZ";
  var mesh_4 = new BABYLON.MeshBuilder.CreatePlane("NX", { height: size, width: size }, scene);
  mesh_4.position = new BABYLON.Vector3(-(size/2),0,0);
  mesh_4.rotation = new BABYLON.Vector3(0,-1.5707963267948966,0);
  mesh_4.scaling = new BABYLON.Vector3(1,1,1);
  mesh_4.isVisible = true;
  mesh_4.id = "NX";
  var mesh_5 = new BABYLON.MeshBuilder.CreatePlane("PX", { height: size, width: size }, scene);
  mesh_5.position = new BABYLON.Vector3((size/2),0,0);
  mesh_5.rotation = new BABYLON.Vector3(0,1.5707963267948966,0);
  mesh_5.scaling = new BABYLON.Vector3(1,1,1);
  mesh_5.isVisible = true;
  mesh_5.id = "PX";
  var mesh_6 = new...