Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//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