-
Notifications
You must be signed in to change notification settings - Fork 0
/
ngoalpost.js
54 lines (40 loc) · 2.29 KB
/
ngoalpost.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// var createScene = function () {
// // This creates a basic Babylon Scene object (non-mesh)
// var scene = new BABYLON.Scene(engine);
// // This creates and positions a free camera (non-mesh)
// var camera = new BABYLON.FreeCamera("camera1", new BABYLON.Vector3(0, 5, -10), scene);
// // This targets the camera to scene origin
// camera.setTarget(BABYLON.Vector3.Zero());
// // This attaches the camera to the canvas
// camera.attachControl(canvas, true);
// // This creates a light, aiming 0,1,0 - to the sky (non-mesh)
// var light = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 1, 0), scene);
// // Default intensity is 1. Let's dim the light a small amount
// light.intensity = 0.9;
// // Our built-in 'ground' shape. Params: name, width, depth, subdivs, scene
// var ground = BABYLON.Mesh.CreateGround("ground1", 6, 6, 2, scene);
// // Materials
// var mat1 = new BABYLON.StandardMaterial('mat1', scene);
// mat1.diffuseColor = new BABYLON.Color3(0, 1, 0);
// var mat2 = new BABYLON.StandardMaterial('mat2', scene);
// mat2.diffuseColor = new BABYLON.Color4(0.18, 0.21, 0.18);
// var base = BABYLON.MeshBuilder.CreateBox("base", { size: 1, width: 6 }, scene);
// base.position = new BABYLON.Vector3(0, 1.5, 0);
// base.material = mat2;
// var hbar = BABYLON.MeshBuilder.CreateBox("hbar", { size: 1, height: 1, width: 6 }, scene);
// hbar.position = new BABYLON.Vector3(0, 3.5, -2);
// hbar.material = mat2;
// var vbar1 = BABYLON.MeshBuilder.CreateBox("vbar1", { size: 1, height: 3, width: 1 }, scene);
// vbar1.position = new BABYLON.Vector3(-2.5, 1.5, -2);
// vbar1.material = mat1;
// var vbar2 = BABYLON.MeshBuilder.CreateBox("vbar2", { size: 1, height: 3, width: 1 }, scene);
// vbar2.position = new BABYLON.Vector3( 2.5, 1.5, -2);
// vbar2.material = mat1;
// var c1 = BABYLON.MeshBuilder.CreateBox("c1", { size: 1, depth: 3}, scene);
// c1.position = new BABYLON.Vector3( 2.5, 0.5, -1);
// c1.material = mat2;
// var c2 = BABYLON.MeshBuilder.CreateBox("c2", { size: 1, depth: 3}, scene);
// c2.position = new BABYLON.Vector3( -2.5, 0.5, -1);
// c2.material = mat2;
// return scene;
// };