+ Reply to Thread
Results 1 to 7 of 7

Thread: Processing on the Web

  1. #1
    Guru debtboy is just really nice debtboy is just really nice debtboy is just really nice debtboy is just really nice debtboy is just really nice debtboy's Avatar
    Join Date
    Aug 2009
    Location
    I'm in the... Black Lodge
    Posts
    908

    Smile Processing on the Web

    This tutorial is a brief intro to the Processing Language
    and Processing.js (Processing ported to Javascript).

    The Processing Language
    Here is the opening paragraph from Processing.org
    Processing is an open source programming language and environment for people who want to program images, animation, and interactions. It is used by students, artists, designers, researchers, and hobbyists for learning, prototyping, and production. It is created to teach fundamentals of computer programming within a visual context and to serve as a software sketchbook and professional production tool.

    Below are 2 images where I use the Processing IDE to create a simple animation and execute it.





    I have to say...
    Processing is by far the easiest language I've tried, but it offers some awesome graphic capabilities.
    The syntax is very easy to understand, just click Help -> Reference in the IDE or click the
    Reference Tab at Extended Language (API) \ Processing 1.0




    Processing.js (Processing Language ported to javascript)
    Here is the opening paragraph from Processingjs.org
    Processing.js is an open programming language for people who want to program images, animation, and interactions for the web without using Flash or Java applets. Processing.js uses Javascript to draw shapes and manipulate images on the HTML5 Canvas element. The code is light-weight, simple to learn and makes an ideal tool for visualizing data, creating user-interfaces and developing web-based games.
    Processing.js runs in FireFox, Safari, Opera, Chrome and will also work with Internet Explorer, using Explorer Canvas.

    Processing.js requires a few javascript files/libraries which can be downloaded here:
    Processing.js




    The commands available for Processing.js are slightly reduced and can be found here:
    Processing.js. It you click the "toggle all" link on this page, it shows the Processing commands that are not available to Processing.js



    Here is a simple website using the script I created above.

    Code:
    <!DOCTYPE html>
    <html>
    <head>
      <title>Debtboy's Processing Language Site</title>
      <script src="./js/init.js"></script>
      <script src="./js/processing.js"></script>
    </head>
    
    <body>
      <center>
    
      <h2>Debtboy's Processing Ported to Javascript Site</h2>
    
      <script type="application/processing" target="debtboy_canvas">
        float a = 0.0;
        float s = 0.0;
        PImage img1;
    
        void setup()
        {
          size(400,400);
          noStroke();
          frameRate(20);
          img1 = loadImage( "./images/debtboy_cow.jpg" );
        }
    
        void draw()
        {
          background(255);
          a = a + 0.04;
          s = cos(a)*2;
      
          translate(width/2, height/2);
          scale(s); 
    
    
          image(img1,-103,-90);
        }
      </script>
      <canvas width="300" height="300" id="debtboy_canvas"></canvas>
      <br></br>
      </center>
    </body>
    </html>
    Note the javascript libraries in the <head></head> section:
    Code:
      <script src="./js/init.js"></script>
      <script src="./js/processing.js"></script>
    Note the simple script creating this neat graphical effect:
    Code:
      <script type="application/processing" target="debtboy_canvas">
        float a = 0.0;
        float s = 0.0;
        PImage img1;
    
        void setup()
        {
          size(400,400);
          noStroke();
          frameRate(20);
          img1 = loadImage( "./images/debtboy_cow.jpg" );
        }
    
        void draw()
        {
          background(255);
          a = a + 0.04;
          s = cos(a)*2;
      
          translate(width/2, height/2);
          scale(s); 
    
    
          image(img1,-103,-90);
        }
      </script

    Note that the canvas object is used:
    Code:
    <canvas width="400" height="400" id="debtboy_canvas"></canvas>

    Here is a link to my website with the animation:
    Debtboy's Processing Language Site


    Below are a few website images (at different points) of the running animation:









    I'm quite impressed by Processing and Processing.js capabilities. I'll be experimenting quite a bit with this language on my member website. It's very easy to understand and use which are sought after features for a lazy programmer like myself

    If you haven't already... give Processing (Processing.js) a try.
    The owls are not what they seem...

  2. #2
    Administrator Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan's Avatar
    Join Date
    Nov 2005
    Location
    Hendersonville, NC
    Posts
    24,556
    Blog Entries
    97

    Re: Processing on the Web

    That is so cool! The animation on your site is very smooth. Nicely formated tutorial as well!

    Why didn't you attach the images or upload them to your CC site (vs your Comcast site)?

    +rep!

  3. #3
    Code Warrior
    /////////|||||\\\\\\\\\
    amrosama is a splendid one to behold amrosama is a splendid one to behold amrosama is a splendid one to behold amrosama is a splendid one to behold amrosama is a splendid one to behold amrosama is a splendid one to behold amrosama is a splendid one to behold amrosama's Avatar
    Join Date
    Aug 2007
    Location
    Pyramids st, Giza, Egypt
    Age
    21
    Posts
    8,182
    Blog Entries
    12

    Re: Processing on the Web

    love this tutorial *bookmark*
    ive always been interested in canvas +rep

  4. #4
    Code Slinger chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5's Avatar
    Join Date
    Mar 2008
    Posts
    7,023
    Blog Entries
    1

    Re: Processing on the Web

    Very cool! +rep
    "Whenever you remember, I'll be there/
    Remember how we reached that dream together" - Carrie Underwood

  5. #5
    Programming God zeroradius will become famous soon enough zeroradius's Avatar
    Join Date
    Feb 2008
    Location
    Ohio
    Posts
    827

    Re: Processing on the Web

    Nice tutorial + rep

    Does this offer any advantages over using something such as flash, other than the user not having to download flash to use it? Does it have capabilities that make it easier than making an animated gif or is it just somthing fun to do and not for serious production?


  6. #6
    Guru debtboy is just really nice debtboy is just really nice debtboy is just really nice debtboy is just really nice debtboy is just really nice debtboy's Avatar
    Join Date
    Aug 2009
    Location
    I'm in the... Black Lodge
    Posts
    908

    Re: Processing on the Web

    Thanks everyone for the positive feedback

    Quote Originally Posted by zeroradius View Post
    Nice tutorial + rep

    Does this offer any advantages over using something such as flash, other than the user not having to download flash to use it? Does it have capabilities that make it easier than making an animated gif or is it just somthing fun to do and not for serious production?
    It's free/open and very easy to program, but you will
    have to decide for yourself.
    The owls are not what they seem...

  7. #7
    Programming God zeroradius will become famous soon enough zeroradius's Avatar
    Join Date
    Feb 2008
    Location
    Ohio
    Posts
    827

    Re: Processing on the Web

    I guess every thing is worth trying once (^_^)


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Replies: 0
    Last Post: 10-27-2009, 08:11 PM
  2. Replies: 4
    Last Post: 04-20-2009, 01:53 PM
  3. FIFO For Batch Processing?
    By TcM in forum Programming Theory
    Replies: 2
    Last Post: 07-30-2008, 12:22 PM
  4. Matlab &image processing?
    By Genuis in forum General Programming
    Replies: 5
    Last Post: 02-20-2008, 11:04 AM
  5. Processing
    By Matt in forum General Programming
    Replies: 2
    Last Post: 07-12-2007, 12:45 PM

Bookmarks

Bookmarks

     
        Algorithms and Data Structures

        Java tutorials

        Algorithms Forum

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts