Skip to content

Instantly share code, notes, and snippets.

@deltakosh
Created March 6, 2023 22:50
Show Gist options
  • Save deltakosh/3c3d9b2581aba450c335903c022a8e3d to your computer and use it in GitHub Desktop.
Save deltakosh/3c3d9b2581aba450c335903c022a8e3d to your computer and use it in GitHub Desktop.
var createScene = function () {
var scene = new BABYLON.Scene(engine);
// Let's create our potato
var potato = BABYLON.MeshBuilder.CreateSphere("potato",
{ diameterX: 0.8, diameterY: 0.9, diameterZ: 0.8 },
scene);
// Environment
scene.createDefaultCamera(true, true, true);
scene.createDefaultEnvironment({
enableGroundMirror: true,
createSkybox: false,
});
// Prevent camera from going below the ground
scene.activeCamera.upperBetaLimit = 1.5;
return scene;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment