WebGL Container

Developer
Size
2,300 Kb
Views
18,216

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 Previews

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();
});
WebGL Container - Script Codes
WebGL Container - Script Codes
Home Page Home
Developer Daniel Gooß
Username daniel_gooss
Uploaded November 10, 2022
Rating 3
Size 2,300 Kb
Views 18,216
Do you need developer help for WebGL Container?

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!

Daniel Gooß (daniel_gooss) Script Codes
Create amazing SEO content with AI!

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!