processing-p5-convert

source code translator that converts Processing Java code to p5.js Javascript code

Home Minimal_example Command_line Notes About Project

(tests) hello bounce grid bounce_with_class cat hello_font hello_sound explode bounce_vectors hello_3d

(live conversion tests) phyllotaxis dandelin dogfooding

(student project tests) cow_game cross_the_road dinosaur_game greenhouse_game

Command line usage

Installation

Clone the repository:

git clone git@github.com:dkessner/processing-p5-convert.git

Change to the project directory and install the ppconvert command line tool.

cd processing-p5-convert
make install-cli

Usage

Type ppconvert with no arguments for usage:

Usage: ppconvert [option] filename1.pde [filename2.pde ...]
Options:
  [none]       : output converted p5.js code
  --reconstruct: output reconstructed Processing code
  --raw        : output syntax tree
  --outline    : output outline

Try it out on hello/hello.pde:

ppconvert hello/hello.pde

Output:

//
// hello
//
function setup() {
    createCanvas(400, 400);
}
function draw() {
    background(0);
    fill("#00ff00"); // Processing color literal
    ellipse(200, 200, 100, 100);
}
home