Install this theme
import processing.core._import PConstants._import processing.core.PApplet._import scala.collection.parallel.mutable/** * Created by martin.silberkasten on 16/07/2014. */class sketch2 extends PApplet{  var lst= List.fill(200)((new PVector(),random(1,25)))  var g1, g2, g3, m1, m2:PGraphics = null  override def setup{    size(400,400, P2D)    background(255)    stroke(255)    noFill()    lst.foreach(x=>x._1.set(random(width),random(height)))    g1=createGraphics(width,height, P2D)    g2=createGraphics(width,height, P2D)    g3=createGraphics(width,height, P2D)    m1=createGraphics(width,height, P2D)    m2=createGraphics(width,height, P2D)  }  override def draw{    moveFigures()    drawFigures(g1,(g,t)  => fill() g.rect(t._1.x,t._1.y,t._2,t._2))    drawFigures(g2, (g,t) => g.triangle(t._1.x,t._1.y+t._2, t._1.x+t._2,t._1.y+t._2, t._1.x+t._2/2,t._1.y))    drawFigures(g3, (g,t) => g.ellipse(t._1.x+t._2/2,t._1.y+t._2/2,t._2,t._2))    drawMask(m1, 0)    drawMask(m2, QUARTER_PI)    //image(m.get(),0,0)    image(g1,0,0)    val tmpG2 = g2.get()    tmpG2.mask(m1.get())    image(tmpG2,0,0)    val tmpG3 = g3.get()    tmpG3.mask(m2.get())    image(tmpG3,0,0)    if(frameCount%2==0) saveFrame(“####.png”)  }  def moveFigures(){    for((p,s)<-lst) {      p.add(PVector.fromAngle(noise(p.x * 0.01f, p.x * 0.01f) * PI - HALF_PI))      if(p.x>width) p.set(-s,random(height))      if(p.y>height) p.set(p.x,-s)      if(p.y+s<0) p.set(p.x,height)    }  }  def drawFigures(g: PGraphics,f:(PGraphics, (PVector, Float))=>Unit){    g.beginDraw()    g.background(0)    lst.foreach(x=>f(g,x))    g.endDraw()  }  def drawMask(m:PGraphics,offset:Float){    m.beginDraw()    m.background(0)    m.fill(255)    val s = abs(sin(frameCount*0.05f+offset))*550    m.ellipse(width/2, height/2, s, s)    m.endDraw()  }}

import processing.core._
import PConstants._
import processing.core.PApplet._

import scala.collection.parallel.mutable

/** * Created by martin.silberkasten on 16/07/2014. */
class sketch2 extends PApplet{
  var lst= List.fill(200)((new PVector(),random(1,25)))
  var g1, g2, g3, m1, m2:PGraphics = null
  override def setup{
    size(400,400, P2D)
    background(255)
    stroke(255)
    noFill()
    lst.foreach(x=>x._1.set(random(width),random(height)))
    g1=createGraphics(width,height, P2D)
    g2=createGraphics(width,height, P2D)
    g3=createGraphics(width,height, P2D)
    m1=createGraphics(width,height, P2D)
    m2=createGraphics(width,height, P2D)
  }

  override def draw{
    moveFigures()
    drawFigures(g1,(g,t)  => fill() g.rect(t._1.x,t._1.y,t._2,t._2))
    drawFigures(g2, (g,t) => g.triangle(t._1.x,t._1.y+t._2, t._1.x+t._2,t._1.y+t._2, t._1.x+t._2/2,t._1.y))
    drawFigures(g3, (g,t) => g.ellipse(t._1.x+t._2/2,t._1.y+t._2/2,t._2,t._2))
    drawMask(m1, 0)
    drawMask(m2, QUARTER_PI)
    //image(m.get(),0,0)
    image(g1,0,0)

    val tmpG2 = g2.get()
    tmpG2.mask(m1.get())
    image(tmpG2,0,0)

    val tmpG3 = g3.get()
    tmpG3.mask(m2.get())
    image(tmpG3,0,0)

    if(frameCount%2==0) saveFrame(“####.png”)
  }

  def moveFigures(){
    for((p,s)<-lst) {
      p.add(PVector.fromAngle(noise(p.x * 0.01f, p.x * 0.01f) * PI - HALF_PI))
      if(p.x>width) p.set(-s,random(height))
      if(p.y>height) p.set(p.x,-s)
      if(p.y+s<0) p.set(p.x,height)
    }
  }

  def drawFigures(g: PGraphics,f:(PGraphics, (PVector, Float))=>Unit){
    g.beginDraw()
    g.background(0)
    lst.foreach(x=>f(g,x))
    g.endDraw()
  }

  def drawMask(m:PGraphics,offset:Float){
    m.beginDraw()
    m.background(0)
    m.fill(255)
    val s = abs(sin(frameCount*0.05f+offset))*550
    m.ellipse(width/2, height/2, s, s)
    m.endDraw()
  }
}

Blehhrggg&#8230;..

Blehhrggg…..

drawLines((x,y,z)=&gt; vertex(cos(x)*sin(z)*250,sin(x)*cos(z)*250,sin(x)*250))

drawLines((x,y,z)=> vertex(cos(x)*sin(z)*250,sin(x)*cos(z)*250,sin(x)*250))

Variation&#8230;
drawLines((x,y,z)=&gt; vertex(cos(x)*sin(z)*250,sin(x)*cos(z)*250,tan(x)*250))

Variation…

drawLines((x,y,z)=> vertex(cos(x)*sin(z)*250,sin(x)*cos(z)*250,tan(x)*250))

drawLines((x,y,z)=&gt; vertex(sin(x)*sin(z)*250,sin(x)*cos(z)*250,sin(x)*250))

drawLines((x,y,z)=> vertex(sin(x)*sin(z)*250,sin(x)*cos(z)*250,sin(x)*250))

1.
drawLines((x,y,z)=> vertex(x*z*z*stepSize*0.1f,0,z*x*x*stepSize*0.1f))
2.
drawLines((x,y,z)=> vertex(x*z*z*stepSize*0.01f,z*x,z*x*x*stepSize*0.01f))
drawLines((x,y,z)=> vertex(z*x*x*stepSize*0.01f,x*z,x*z*z*stepSize*0.01f))

Frequency&#8230;

drawLines((x,y,z)=&gt; vertex(x*stepSize,sin(x*z*frameCount*0.001f)*20,z*stepSize))drawLines((x,y,z)=&gt; vertex(z*stepSize,-cos(x*z*frameCount*0.001f)*20,x*stepSize))

Frequency…

drawLines((x,y,z)=> vertex(x*stepSize,sin(x*z*frameCount*0.001f)*20,z*stepSize))
drawLines((x,y,z)=> vertex(z*stepSize,-cos(x*z*frameCount*0.001f)*20,x*stepSize))

drawLines((x,y,z)=> vertex(x*stepSize,tan(x+z),z*stepSize))