Skip to content

Instantly share code, notes, and snippets.

@flushpot1125
Created August 15, 2018 03:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flushpot1125/56821741e65b3872b8f9b3106b8d50bc to your computer and use it in GitHub Desktop.
Save flushpot1125/56821741e65b3872b8f9b3106b8d50bc to your computer and use it in GitHub Desktop.
//Skyboxは空間を覆う巨大な立方体なので、CreateBoxで箱を定義する
var skybox = BABYLON.MeshBuilder.CreateBox("skyBox", {size:5000.0}, scene);
//Skyboxのマテリアルを定義。実際はStandardMaterialでCubeTextureとテクスチャの設定によって、Skyboxを表現する
var skyboxMaterial = new BABYLON.StandardMaterial("skyBox", scene);
skyboxMaterial.backFaceCulling = false;
skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("textures/night_star", scene);
skyboxMaterial.reflectionTexture.coordinatesMode = BABYLON.Texture.SKYBOX_MODE;
skyboxMaterial.diffuseColor = new BABYLON.Color3(0, 0, 0);
skyboxMaterial.specularColor = new BABYLON.Color3(0, 0, 0);
skybox.material = skyboxMaterial;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment