Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var grassMaterial = new BABYLON.StandardMaterial("grass", scene);
var grassTexture = new GrassProceduralTexture("textgrass", 256, scene);
grassMaterial.ambientTexture = grassTexture;
grassMaterial.diffuseTexture= grassTexture;
// Create Ground
var ground = BABYLON.Mesh.CreatePlane("ground", 25.0, scene);
ground.position = new BABYLON.Vector3(0, -5, 0);
ground.rotation = new BABYLON.Vector3(Math.PI / 2, 0, 0);
ground.material = grassMaterial;
// Create the 3D UI manager
var manager = new GUI.GUI3DManager(scene);
// Create a horizontal stack panel
var panel = new GUI.StackPanel3D();
panel.margin = 0.02;
manager.addControl(panel);
startGameButton(panel);
addLabelToScene();
// Enable VR
var helper = scene.createDefaultVRExperience({createDeviceOrientationCamera: false});
helper.enableInteractions();
return scene;
}