Replaced noise with wave.

This commit is contained in:
Devine Lu Linvega 2016-11-15 18:11:04 -08:00
parent 941c9d6575
commit 7b6c629e1e
3 changed files with 25 additions and 3 deletions

View File

@ -84,8 +84,27 @@ $ ! ; Clear temporary storage
# 6 strands
> 600,400 60' 3;> 600,400 120' 3;> 600,400 180' 3;> 600,400 240' 3;> 600,400 300' 3
```
##Symmetry Brush
```
# XY
> 600,400 45' 3
```
##Angular Brush
```
# Light
> 1,1;> 2,2;> 3,3;> 4,4
# Hard
> 2,2;> 4,4;> 6,6;> 8,8
# Horizontal Noise
> 0,10 ?1;> 0,5 ?1;> 0,-5 ?1;> 0,-10 ?1
```
##Noise Brush
```
# Tight
> 0,0.1 ?5;> 0,-0.1 ?5;> 0.1,0 ?5;> -0.1,0 ?5
# Glitch
> ?10;> ?10;> ?10;> ?10;> ?10;> ?10;> ?10;> ?10;
```

View File

@ -5,6 +5,7 @@ function Pointer(offset = new Position(), color = new Color('000000'))
this.noise = null;
this.position_prev = null;
this.angle = null;
this.distance = 0;
this.draw = function()
{
@ -13,9 +14,11 @@ function Pointer(offset = new Position(), color = new Color('000000'))
var position = this.position();
this.distance += position.distance_to(this.position_prev);
if(this.noise){
position.x += (Math.random() * this.noise) - (this.noise/2);
position.y += (Math.random() * this.noise) - (this.noise/2);
position.x += (Math.sin(this.distance/100) * this.noise) - (this.noise/2);
position.y += (Math.sin(this.distance/100) * this.noise) - (this.noise/2);
}
ronin.canvas.context().beginPath();

View File

@ -46,7 +46,7 @@ function Command(content)
this.noise = function()
{
for (i = 0; i < this.content.length; i++) {
if(this.content[i].indexOf("?") >= 0){ return parseInt(this.content[i][1]); }
if(this.content[i].indexOf("?") >= 0){ return parseInt(this.content[i].replace('?','')); }
}
return null;
}