Questions tagged [processing]

Processing is an open source programming language and environment for people who want to create images, animations, interactions, and games.

The processing tag is misleading and leads to misunderstandings and even closure votes, because of the seemingly missing language tag. It is strongly recommended to tag questions additionally with a language tag.

But note Processing is not the same as Java.

Processing refers to the language built on top of Java and the minimal IDE it ships with. It is free and open-source, runs on Linux, Mac OS X, and Windows, and can output for screens, print, 3D packages and CNC printing.

The language simplifies a lot of complex concepts and eases the entry of designers, artists and non-programmers to the world of programming.

Over the years it was used to produce a number of astonishing projects ranging from data visualization, to physical computing , games, 3D, sound, live performance, and more.

Due to its vibrant community, Processing not only enjoys a contribution of over 100 libraries, but it is also present on major mobile platforms, such as Android and iOS.

There are online communities for sharing Processing content, like OpenProcessing.

Some websites even allow users to learn and use Processing directly in the browser, like the Flash-driven SketchPatch and the JavaScript-driven Sketchpad and p5.js (pure JavaScript).

There are also Processing ports to the following languages:

Advanced users are not constrained to the Processing IDE; sketches can be run from the command line, and projects can be set up to build and run directly from editors:

6836 questions
8
votes
2 answers

Android get accelerometers on earth coordinate system

I'd like to get accelerometers on Android and have them on the earth coordinate system, just like on this topic Acceleration from device's coordinate system into absolute coordinate system or here Transforming accelerometer's data from device's…
user3645663
  • 141
  • 1
  • 7
8
votes
3 answers

Use of delay() in Processing Environment

I am using Processing language to sketch a rectangle that grows in size with time. Following code is not giving any output. void setup() { size(900,900); } void draw() { int edge=100; for(int i=0;i<300;i++) { delay(100); …
dev
  • 2,474
  • 7
  • 29
  • 47
8
votes
2 answers

How should resources in a compiled jar be accessed?

First of all, I have read through many S.O. questions regarding this topic and I have tried the things suggested in them. Here is my situation. I am writing a Java app using the Processing framework and I'm in the final stages where I need to begin…
JeremyFromEarth
  • 14,344
  • 4
  • 33
  • 47
8
votes
3 answers

Dynamically "unload" a Processing JS sketch from canvas

I'm using some javascript to allow users to dynamically load a sketch on click to a canvas element using: Processing.loadSketchFromSources('canvas_id', ['sketch.pde']); If I call Processing.loadSketchFromSources(...) a second (or third...) time,…
Andrew Marconi
  • 313
  • 1
  • 9
8
votes
1 answer

How can I use Google Maps with Processing?

I want to use Google Maps API with Processing. Until now I was just able to get Google Places data, but I'm struggling with the map itself. I know about other map options, like unfold or modestMaps, but I need Google. In particular because of the…
7
votes
1 answer

How to add a gradient in a Bezier curve?

I have drawn curves that denote the customer country and the country where he is headed for a trip in a map. But I could not add a gradient so that the lines would denote the said information and gives this random color between two colors at…
Samit Paudel
  • 181
  • 7
7
votes
2 answers

Can i make my p5.js draw() function run only once, and then only on a button click?

I have this snippet of p5.js code: let x = 10; let y = Math.floor(Math.random()*201); let x2 = 190; let y2 = 200 - Math.floor(Math.random()*201); function setup() { createCanvas(200, 200); } function draw() { clear(); y =…
Infinity
  • 73
  • 1
  • 3
7
votes
2 answers

How to enable right click in p5.js?

I'm making a minesweeper clone, left click reveals the cell and right click is supposed to flag the cell. I'm using the function mouseClicked() - this allows me to reveal on left click and also reveal on right click. I tried using if(mouseIsPressed)…
ObamoDank
  • 141
  • 1
  • 2
  • 5
7
votes
2 answers

Talking to Arduino from Scala

Is there a standard way to control an Arduino from Scala? If not I am interested in hacking one together, but am unsure of where I should start. The Firmata library seemed like the way to go but there is no Java or Scala interface. SPDE supports…
airboss
  • 73
  • 1
  • 3
7
votes
1 answer

Can't find a way to color the Mandelbrot-set the way i'm aiming for

I've been successful in coloring the Mandelbrot-set although I can't zoom in very far until it becomes "blurry" and the pattern stops. I fix this by increasing the max_iteration, this works but I get very few colors at *1 magnification and lot's of…
MorganS42
  • 656
  • 4
  • 21
7
votes
2 answers

Cannot locate connected device in Processing

I'm having trouble getting Processing 3.3.6 (x64) for Windows 10 to recognize my LG V20 android device. At first, I was getting a NoClassDefFoundError when I tried to run a sketch, and the Android SDK updater had 2 suggested updates that I couldn't…
Vedvart1
  • 302
  • 4
  • 21
7
votes
1 answer

Java one liner for loop

Here, someone made a one-liner for loop in Python. Another example is this: someList = [f(i) for i in range(16)] which would be a one-liner for this code: someList = [] for i in range(16): someList.append(f(i)) or, in Java: int[] someList =…
The Holy See
  • 193
  • 1
  • 1
  • 4
7
votes
2 answers

My planets went crazy - a Java related issue

This morning I felt like writing a useless program and I ended up with this extremely minimal astronomic simulator in processing. MCVE version of code attached at the end of the post. Then I added some planets, sit back and got ready to enjoy…
shi
  • 286
  • 1
  • 9
7
votes
3 answers

Save a Processing sketch to a PNG file, server-side with no GUI/display

I'd like to use Processing to render a visualization on the server side (headlessly, with no GUI). The Processing sketch is static (i.e. does not animate), so I only need to grab the first frame, and I'd like to serve this result out to the users of…
Maciek
  • 3,322
  • 6
  • 28
  • 35
7
votes
1 answer

Convert processing sketch into executable

I am using processing, and cannot figure out how to turn my processing sketch into an .exe file. So far nothing has worked. I have a lot of images in different folders within my processing sketch, and I cannot seem to figure out the steps I need to…
Yaxlat
  • 665
  • 1
  • 10
  • 25