{"id":"SRZRWV","version":1771,"description":"","jsonPayload":"{\"code\":\"var createScene = function () {\\r\\n\\r\\n    // This creates a basic Babylon Scene object (non-mesh)\\r\\n    var scene = new BABYLON.Scene(engine);\\r\\n\\r\\n    /********** ARC ROTATE CAMERA EXAMPLE **************************/\\r\\n\\r\\n    // Creates, angles, distances and targets the camera\\r\\n    var camera = new BABYLON.ArcRotateCamera(\\\"Camera\\\", -1.9777, 0.9097, 26.6475, new BABYLON.Vector3(0, 0, 0), scene);\\r\\n\\r\\n    // This attaches the camera to the canvas\\r\\n    camera.attachControl(canvas, true);\\r\\n\\r\\n    // Auto rotate\\r\\n    camera.useAutoRotationBehavior = true;\\r\\n\\r\\n    /**************************************************************/\\r\\n\\r\\n    // This creates a light, aiming 0,1,0 - to the sky (non-mesh)\\r\\n    var light = new BABYLON.HemisphericLight(\\\"light\\\", new BABYLON.Vector3(0, 1, 0), scene);\\r\\n\\r\\n    //Materials\\r\\n    var mat = new BABYLON.StandardMaterial(\\\"mat\\\", scene);\\r\\n    mat.alpha = 0.5;\\r\\n    mat.specularPower = 8;\\r\\n\\r\\n    //highlightlayer\\r\\n    let hl = new BABYLON.HighlightLayer(\\\"highlight_layer\\\", scene, {\\r\\n        mainTextureFixedSize: 512,\\r\\n        blurHorizontalSize: 1,\\r\\n        blurTextureSizeRatio: 1,\\r\\n    });\\r\\n\\r\\n    // 2d GUI\\r\\n    const gui = BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI(\\\"ui\\\");\\r\\n\\r\\n    const createButton = (parent) => {\\r\\n        var button = BABYLON.GUI.Button.CreateSimpleButton(\\\"button\\\", parent.name);\\r\\n        button.top = \\\"0px\\\";\\r\\n        button.left = \\\"0px\\\";\\r\\n        button.width = \\\"150px\\\";\\r\\n        button.height = \\\"50px\\\";\\r\\n        button.cornerRadius = 20;\\r\\n        button.thickness = 4;\\r\\n        button.children[0].color = \\\"#DFF9FB\\\";\\r\\n        button.children[0].fontSize = 24;\\r\\n        button.color = \\\"#FF7979\\\";\\r\\n        button.background = \\\"#EB4D4B\\\";\\r\\n        gui.addControl(button);\\r\\n        button.linkWithMesh(parent);\\r\\n        button.linkOffsetY = \\\"10px\\\";\\r\\n    }\\r\\n\\r\\n    for (let i = 1; i <= 25; i++) {\\r\\n        var box = BABYLON.MeshBuilder.CreateBox(`box${i}`, { width: 2, height: 2, depth: 2 }, scene);\\r\\n        box.material = mat;\\r\\n        box.position.y = 1;\\r\\n        if (i % 5 === 0) {\\r\\n            box.position.x = -6 + parseInt((i - 2) % 5) * 3 + 3;\\r\\n            box.position.z = 6 - parseInt((i - 1) / 5) * 3;\\r\\n        } else {\\r\\n            box.position.x = -6 + parseInt((i - 1) % 5) * 3;\\r\\n            box.position.z = 6 - parseInt((i - 1) / 5) * 3;\\r\\n        }\\r\\n        box.enableEdgesRendering();\\r\\n        box.edgesWidth = 2;\\r\\n        box.edgesColor = new BABYLON.Color3(1, 0.2, 0)\\r\\n        hl.addMesh(box, new BABYLON.Color3(0.95, 0.33, 0.31));\\r\\n        createButton(box);\\r\\n    }\\r\\n\\r\\n    var ground = BABYLON.MeshBuilder.CreateGround(\\\"ground1\\\", { width: 20, height: 20, subdivisions: 2 }, scene);\\r\\n\\r\\n    return scene;\\r\\n\\r\\n};\"}","name":"GUI shaking","snippetIdentifier":"SRZRWV-1771","tags":"","date":"2023-07-27T06:18:07.312Z"}