WebGL Container
How do I make an webgl container?
What is a webgl container? How do you make a webgl container? This script and codes were developed by Daniel Gooß on 10 November 2022, Thursday.
WebGL Container - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>WebGL Container</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <canvas id="renderCanvas" width="720" height="480"></canvas> <script src='https://www.babylonjs.com/babylon.js'></script> <script src="js/index.js"></script>
</body>
</html>
WebGL Container - Script Codes CSS Codes
body { margin: 0;
}
#renderCanvas { width: 100%;
}
WebGL Container - Script Codes JS Codes
var canvas = document.getElementById("renderCanvas");
var engine = new BABYLON.Engine(canvas, true);
var createScene = function() { var scene = new BABYLON.Scene(engine); scene.clearColor = new BABYLON.Color3(1, 1, 1); var camera = new BABYLON.ArcRotateCamera("ArcRotateCamera", 0, 0, 0, BABYLON.Vector3.Zero(), scene); camera.setPosition(new BABYLON.Vector3(-5, 2, -6)); // This attaches the camera to the canvas camera.attachControl(canvas, false); // This creates a light, aiming 0,1,0 - to the sky. var light = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 1, 0), scene); light.intensity = 0.75; var spotlight = new BABYLON.DirectionalLight("dir01", new BABYLON.Vector3(5, -5, 5), scene); spotlight.intensity = 0.75; var ground = BABYLON.Mesh.CreateGround("ground1", 10, 10, 0, scene); ground.receiveShadows = true; var shadowGenerator = new BABYLON.ShadowGenerator(1024, spotlight); //shadowGenerator.useBlurVarianceShadowMap = true; shadowGenerator.bias = 0.0000005; BABYLON.SceneLoader.ImportMesh("container", "https://dl.dropboxusercontent.com/u/14956386/container/", "container.babylon", scene, function(newMeshes, particleSystems) { var container = newMeshes[0]; //container.receiveShadows = true; var material1 = new BABYLON.StandardMaterial("texture1", scene); material1.diffuseColor = new BABYLON.Color3(0.906, 0.322, 0); container.material = material1; //material1.wireframe = true; shadowGenerator.getShadowMap().renderList.push(container); }); return scene;
};
var scene = createScene();
engine.runRenderLoop(function() { scene.render();
});
window.addEventListener("resize", function() { engine.resize();
});
Developer | Daniel Gooß |
Username | daniel_gooss |
Uploaded | November 10, 2022 |
Rating | 3 |
Size | 2,300 Kb |
Views | 18,216 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Folded Video | 3,913 Kb |
IPhone Ui - Content only | 6,499 Kb |
CSS Tab-Nav | 3,698 Kb |
CSS Blur Effect | 3,176 Kb |
Revolver Slideshow with Touch | 7,609 Kb |
Apple menu redesign | 25,821 Kb |
CSS Paperfold Effect | 3,473 Kb |
Web Component Switches | 4,335 Kb |
Text Transition Effect | 232,607 Kb |
Navigation concept | 14,510 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Default Input, Textareas, Submits, and Buttons in iOS | Demersdesigns | 2,334 Kb |
SVG email test v2.0 | M_J_Robbins | 2,090 Kb |
Ripples in water | Nobitagit | 2,704 Kb |
A form arranged using automatic placement. | Vikasford | 2,103 Kb |
A Pen by Xand0r | Xand0r | 1,928 Kb |
Konami Code Easter Egg | Teolitto | 3,051 Kb |
ASCII triangle image overlay | Mitchdot | 2,200 Kb |
Draggables in pure angular | Rlo206 | 5,167 Kb |
Myprofile | SoufianeAbid | 2,451 Kb |
Header | Er40 | 1,542 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!