Questions tagged [processing.js]

A discontinued (Dec. 2018) JavaScript port of the Processing language API v2. Use this tag for existing Processing.js codebases. For new projects, the Processing.js team recommends using P5js instead.

Processing.js was a sister project to the popular Processing visual programming language designed for the web from 2011 to December 2018, when it was archived.

It made data visualizations, digital art, interactive animations, educational graphs, video games, etc. work using web standards and without any plug-ins.

Processing started as an open source programming language based on Java to help the electronic arts and visual design communities learn the basics of computer programming in a visual context.

This specific port was retired in December 2018, with people who wish to write Processing for the web being encouraged to use the much newer p5.js project instead: .

482 questions
3
votes
1 answer

Can I build a "JavaScript Mode" version of a Processing sketch using the command line?

I'm using the "b-g" Processing build system for Sublime Text 2 (link) which works perfectly fine. It's using the following command to initiate the build via the processing-java executable (I'm on Windows btw): "cmd": ["processing-java",…
3
votes
1 answer

How to correctly/cleanly draw SVG graphics using ProcessingJS?

I'm getting started with ProcessingJS and I'm currently playing with SVG a bit. Unfortunately I've ran into a strange behaviour displaying SVG. Here is the output: and here is the code that produces that:
George Profenza
  • 50,687
  • 19
  • 144
  • 218
3
votes
1 answer

Load processing.js sketch after window is fully loaded with innerHTML?

My processing.js sketch has a size() call that depends on the window being loaded as it grabs the size of a div. 50% of the time, the sketch loads before the CSS kicks in, so the sketch doesn't have the right size. I figure the best way to combat…
prismspecs
  • 1,482
  • 6
  • 20
  • 35
3
votes
3 answers

Processingjs - PImage error when using in JS mode - trying to load images in JS mode

I'm using the following code listed in the processingjs docs to load an image onto the canvas. Because I'm using this in JS mode, I'm prefixing the Processingjs code with Processing object, e.i. the "processing." /* @pjs preload="laDefense.jpg";…
user1646145
  • 65
  • 1
  • 8
3
votes
1 answer

volume rendering using processing.js

Given a stack of 2d images, how do I produce a volume-rendered effect using Processing/Processing.js? Currently my idea is to do the volume rendering using java (something like imageJ)->obtain the faces of the volume-rendered image as individual…
2
votes
1 answer

processing.js using sketches as backgrounds

I want to use a sketch written with PDE as a background to a webpage. Is this possible? I tried using the sketch.pde file in this css code but no joy: html { background: url(sketch.pde) no-repeat center center fixed; } Update I set the canvas…
Oliver Burdekin
  • 1,098
  • 2
  • 17
  • 36
2
votes
2 answers

Using Mask in processing.js

I'm pretty new with Processing.js and I was wondering why this simple mask is not working? I mean, I can display the image and the mask without any problem, but as soon as it reach the line img1.mask(mask1); everything stop working. /* @pjs…
Simon Arnold
  • 15,849
  • 7
  • 67
  • 85
2
votes
2 answers

Importing processing.webgl for 3d canvas when using processing.js in pure javascript

I would like to utilize some of the 3D shapes in processing.js. I see that if I was using the processing 'language' I could just import processing.webgl.* And the compiler would ignore the import statement. However I am currently coding in pure…
rogermushroom
  • 5,486
  • 4
  • 42
  • 68
2
votes
1 answer

writing in processing vs javascript in processing.js

My understanding is that Processing.js converts Processing code into javascript. But if one does not want to write in Processing, one can use methods and properties of the processing object like so: function sketchCirc(processing) { function…
dopatraman
  • 13,416
  • 29
  • 90
  • 154
2
votes
4 answers

processing.js loading external files

I want to split my processing.js code into several files but I'm not sure how. I tried doing