add_svg
This commit is contained in:
+17
-11
@@ -1,31 +1,37 @@
|
|||||||
var path = new Path({
|
var path = new Path({
|
||||||
fillColor: 'black'
|
fillColor: 'black'
|
||||||
});
|
});
|
||||||
|
var url = 'trame.svg';
|
||||||
|
var raster = new Raster(url);
|
||||||
|
|
||||||
var amount = 3
|
var amount = 3
|
||||||
|
|
||||||
for (var i = 0; i < amount; i++) {
|
for (var i = 0; i < amount; i++) {
|
||||||
var point = new Point(600, 650) * Point.random(view.size);
|
raster.position = new Point(300,600) * Point.random(view.size);
|
||||||
path.add(point);
|
// var point = new Point(600, 650) * Point.random(view.size);
|
||||||
console.log(point);
|
path.add(raster.position);
|
||||||
var segment = path.segments[i];
|
var segment = path.segments[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
path.closed = true;
|
||||||
|
path.fullySelected = true;
|
||||||
|
path.clipMask = true;
|
||||||
|
|
||||||
function onFrame(event) {
|
function onFrame(event) {
|
||||||
// Loop through the segments of the path:
|
// Loop through the segments of the path:
|
||||||
|
|
||||||
// A cylic value between -1 and 1
|
// 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:
|
// Change the y position of the segment point:
|
||||||
segment.point.y = sinus * 60 + 100;
|
segment.point.y = sinus * 100 + 100;
|
||||||
|
segment.point.x = sinus * 50 + 150;
|
||||||
|
|
||||||
|
path.smooth();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
path.closed = true;
|
|
||||||
path.fullySelected = true;
|
|
||||||
path.position.x += 1000;
|
|
||||||
path.smooth();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user