Kévin Tessier 5 年之前
父节点
当前提交
f0a0b0f948
共有 2 个文件被更改,包括 3750 次插入11 次删除
  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();
+  }
+}
 
 
 

文件差异内容过多而无法显示
+ 3733 - 0
trame.svg


部分文件因为文件数量过多而无法显示