Kévin Tessier 5 years ago
parent
commit
f0a0b0f948
2 changed files with 3750 additions and 11 deletions
  1. 17 11
      script/script.js
  2. 3733 0
      trame.svg

+ 17 - 11
script/script.js

@@ -1,30 +1,36 @@
 var path = new Path({
   fillColor: 'black'
 });
+var url = 'trame.svg';
+var raster = new Raster(url);
+
 var amount = 3
 
 for (var i = 0; i < amount; i++) {
-  var point = new Point(600, 650) * Point.random(view.size);
-  path.add(point);
-  console.log(point);
+    raster.position = new Point(300,600) * Point.random(view.size);
+  // var point = new Point(600, 650) * Point.random(view.size);
+  path.add(raster.position);
   var segment = path.segments[i];
 }
 
+path.closed = true;
+path.fullySelected = true;
+path.clipMask = true;
+
 function onFrame(event) {
 	// Loop through the segments of the path:
 
 		// A cylic value between -1 and 1
-		var sinus = Math.sin(event.time * 3 + i);
+    for (var i = 0; i <= amount; i++) {
+		var sinus = Math.sin(event.time * 1 + i);
 
 		// Change the y position of the segment point:
-		segment.point.y = sinus * 60 + 100;
-}
-
-path.closed = true;
-path.fullySelected = true;
-path.position.x += 1000;
-path.smooth();
+		segment.point.y = sinus * 100 + 100;
+    segment.point.x = sinus * 50 + 150;
 
+    path.smooth();
+  }
+}
 
 
 

File diff suppressed because it is too large
+ 3733 - 0
trame.svg


Some files were not shown because too many files changed in this diff