• fullscreen
  • muster_01_fjenett_02.pde
  • /**
    *    F├╝lle die Funktion elementMalen() mit einer eigenen Form.
    *
    *    fjenett 20090402
    */
    
    
    import processing.pdf.*;
    
    
    void elementMalen ( )
    {
        strokeWeight( random( grid_size/2 ) );
        
        if ( random(1) > 0.5 )
            line( 0,0, grid_size, grid_size );
        else
            line( 0,0, -grid_size, grid_size );
    }
    
    
    // --------------------------------------------------------------- //
    
    
    int grid_size = 105;
    boolean savePDF = false;
    
    
    void setup ()
    {
        size( 1260, 840 );
    }
    
    
    void draw ()
    {
        if ( savePDF ) beginRecord( PDF, "muster_01_fjenett_02.pdf" );
        
        background( 255 );
        
        for ( int ix = 0; ix < (width/grid_size); ix = ix+1 )
        {
            for ( int iy = 0; iy < (height/grid_size); iy++ )
            {
                pushMatrix();
                    translate( ix*grid_size, iy*grid_size );
                    
                    elementMalen();
                    
                popMatrix();
            }
        }
        
        if ( savePDF ) endRecord();
        
        noLoop();
    }
    
    void mousePressed ()
    {
        redraw();   
    }
    

    code

    tweaks (0)

    about this sketch

    This sketch is running as Java applet, exported from Processing.

    license

    advertisement

    Florian Jenett

    muster 1 example 2

    Add to Faves Me Likey@!
    You must login/register to add this sketch to your favorites.

    click to update

    You need to login/register to comment.