awacke1 commited on
Commit
f8b2ba3
·
1 Parent(s): 496756a

Update backup.html

Browse files
Files changed (1) hide show
  1. 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.CreateTorusKnot("dnaStrand", {
23
- radius: 1.5,
24
- tube: 0.3,
25
- radialSegments: 32,
26
- tubularSegments: 64,
27
- p: 2,
28
- q: 3
 
 
 
 
 
 
 
 
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