result = 0;
point stspace = point((scale*s)+offset,(scale*(1-t))+offset,0);
float i;
float x[100],y[100],line[100],defuzz[100];
point p[100]; p[0] = point(.2,.6,0);
for (i=0;i<100;i+=1) {
x[i] = 2*noise(.5+i);
y[i] = 2*noise(.5+i+13); p[i] = point(x[i],y[i],0);
line[i] = ptlined(p[i],p[i-1],stspace);
defuzz[i] = 1-smoothstep(width-fuzz,width+fuzz,line[i]);
result += defuzz[i];
}

0 comments:
Post a Comment