Spaces:
Running
Running
Update backup.html
Browse files- backup.html +15 -8
backup.html
CHANGED
@@ -19,18 +19,25 @@
|
|
19 |
camera.attachControl(canvas, true);
|
20 |
|
21 |
// Create a DNA strand
|
22 |
-
var dnaStrand = BABYLON.MeshBuilder.
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
}, scene);
|
30 |
|
31 |
// Create the material for the DNA strand
|
32 |
var dnaMaterial = new BABYLON.StandardMaterial("dnaMaterial", scene);
|
33 |
-
dnaMaterial.diffuseTexture = new BABYLON.Texture("https://i.imgur.com/06QxEyj.jpg", scene);
|
34 |
dnaMaterial.emissiveColor = new BABYLON.Color3(0.1, 0.1, 0.1);
|
35 |
dnaMaterial.specularColor = new BABYLON.Color3(0.2, 0.2, 0.2);
|
36 |
|
|
|
19 |
camera.attachControl(canvas, true);
|
20 |
|
21 |
// Create a DNA strand
|
22 |
+
var dnaStrand = BABYLON.MeshBuilder.CreateTube("dnaStrand", {
|
23 |
+
path: [
|
24 |
+
new BABYLON.Vector3(0, 0, 0),
|
25 |
+
new BABYLON.Vector3(0, 2, 0),
|
26 |
+
new BABYLON.Vector3(2, 2, 0),
|
27 |
+
new BABYLON.Vector3(2, 0, 0),
|
28 |
+
new BABYLON.Vector3(2, -2, 0),
|
29 |
+
new BABYLON.Vector3(0, -2, 0),
|
30 |
+
new BABYLON.Vector3(0, 0, 0)
|
31 |
+
],
|
32 |
+
radiusFunction: function(i) {
|
33 |
+
return 0.1 + Math.abs(2 * Math.sin(i * 10));
|
34 |
+
},
|
35 |
+
tessellation: 128,
|
36 |
+
updatable: true
|
37 |
}, scene);
|
38 |
|
39 |
// Create the material for the DNA strand
|
40 |
var dnaMaterial = new BABYLON.StandardMaterial("dnaMaterial", scene);
|
|
|
41 |
dnaMaterial.emissiveColor = new BABYLON.Color3(0.1, 0.1, 0.1);
|
42 |
dnaMaterial.specularColor = new BABYLON.Color3(0.2, 0.2, 0.2);
|
43 |
|