# Processing

**URL:** https://discourse.processing.org/c/processing/6.md?page=119

[Latest](https://discourse.processing.org/latest.md) · [Categories](https://discourse.processing.org/categories.md) · [Tags](https://discourse.processing.org/tags.md)

**Page:** 120

---

## [Close the full screen second window through keyboard or through parent window?](https://discourse.processing.org/t/close-the-full-screen-second-window-through-keyboard-or-through-parent-window/10571)

<div class="topic-metadata">

**Author:** [@stan\_11](https://discourse.processing.org/u/stan_11)\
**Replies:** 3\
**Last updated:** [August 11, 2021, 8:55am UTC](https://discourse.processing.org/t/close-the-full-screen-second-window-through-keyboard-or-through-parent-window/10571 "2021-08-11T08:55:08Z")

</div>

Here is my code PWindow win; public void settings() { size(320, 240); } void setup() { surface.setLocation(20,20); //win = new PWindow(); } void draw() { background(255, 0, 0); fill(255); rect(10, 10…

---

## [Get-the-average-rgb-from-pixels (revisited)](https://discourse.processing.org/t/get-the-average-rgb-from-pixels-revisited/31661)

<div class="topic-metadata">

**Author:** [@paulstgeorge](https://discourse.processing.org/u/paulstgeorge)\
**Replies:** 4\
**Last updated:** [August 11, 2021, 12:48am UTC](https://discourse.processing.org/t/get-the-average-rgb-from-pixels-revisited/31661 "2021-08-11T00:48:25Z")

</div>

@GoToLoop answered this but which of the two methods is better? Is there a reason to change the int for each of the three RGB channels to color??? Both methods work, I just want to understand. get-the-average-rgb-from-…

---

## [Detect shapes split by intersecting lines](https://discourse.processing.org/t/detect-shapes-split-by-intersecting-lines/31641)

<div class="topic-metadata">

**Author:** [@hkjung](https://discourse.processing.org/u/hkjung)\
**Replies:** 4\
**Last updated:** [August 10, 2021, 6:47pm UTC](https://discourse.processing.org/t/detect-shapes-split-by-intersecting-lines/31641 "2021-08-10T18:47:00Z")

</div>

I want to detect separate shapes as lines split the canvas. I saved line intersection points in the list of PVectors, but don’t know how to connect points that complete split shapes separately. Here’s a sample image tha…

---

## [Processing for Android](https://discourse.processing.org/t/processing-for-android/31668)

<div class="topic-metadata">

**Author:** [@markcosmic](https://discourse.processing.org/u/markcosmic)\
**Replies:** 0\
**Last updated:** [August 10, 2021, 6:32pm UTC](https://discourse.processing.org/t/processing-for-android/31668 "2021-08-10T18:32:57Z")

</div>

Can anyone tell me when Processing for Android will be compatible with Processing 4? Thanks

---

## [How to copy the contents of a website](https://discourse.processing.org/t/how-to-copy-the-contents-of-a-website/31646)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 2\
**Last updated:** [August 10, 2021, 11:48am UTC](https://discourse.processing.org/t/how-to-copy-the-contents-of-a-website/31646 "2021-08-10T11:48:50Z")

</div>

Hi! I want to open a link and copy the contents of the website. I do not care if it is HTML code or if I just copy the contents with right click, the only thing I need is automation. I want to copy everything between St…

---

## [Trying to store the previous value of a variable](https://discourse.processing.org/t/trying-to-store-the-previous-value-of-a-variable/31606)

<div class="topic-metadata">

**Author:** [@G03TH3](https://discourse.processing.org/u/G03TH3)\
**Replies:** 6\
**Last updated:** [August 10, 2021, 8:45am UTC](https://discourse.processing.org/t/trying-to-store-the-previous-value-of-a-variable/31606 "2021-08-10T08:45:22Z")

</div>

I’m attempting to create a ball that is moved through the x-axis reading data from an ultrasonic sensor connected to an Arduino, since the ultrasonic sensor sometimes does not gets the wished value for a second(given to …

---

## [Happy Anniversary](https://discourse.processing.org/t/happy-anniversary/31648)

<div class="topic-metadata">

**Author:** [@saberkhan](https://discourse.processing.org/u/saberkhan)\
**Replies:** 0\
**Last updated:** [August 9, 2021, 4:24pm UTC](https://discourse.processing.org/t/happy-anniversary/31648 "2021-08-09T16:24:08Z")

</div>

Happy anniversary @REAS @shiffman @fry :birthday:

---

## [Do i need to upgrade Sketch?](https://discourse.processing.org/t/do-i-need-to-upgrade-sketch/31645)

<div class="topic-metadata">

**Author:** [@sjriga](https://discourse.processing.org/u/sjriga)\
**Replies:** 1\
**Last updated:** [August 9, 2021, 2:31pm UTC](https://discourse.processing.org/t/do-i-need-to-upgrade-sketch/31645 "2021-08-09T14:31:47Z")

</div>

Hi, I’m unable to render 3D in my current version of Sketch, where/how do I upgrade?

---

## [How to make my rects bigger based on proximity (bigger the closer to my mouse) pjs](https://discourse.processing.org/t/how-to-make-my-rects-bigger-based-on-proximity-bigger-the-closer-to-my-mouse-pjs/31637)

<div class="topic-metadata">

**Author:** [@Kenga123456](https://discourse.processing.org/u/Kenga123456)\
**Replies:** 15\
**Last updated:** [August 9, 2021, 10:50am UTC](https://discourse.processing.org/t/how-to-make-my-rects-bigger-based-on-proximity-bigger-the-closer-to-my-mouse-pjs/31637 "2021-08-09T10:50:22Z")

</div>

void setup() { frameRate(60); size(1020, 510); } void draw() { background(0); int spacing\_x = 45; int spacing\_y = 45; for (int x = 0; x \< width + spacing\_x; x = x + spacing\_x) { for (int y = 0; y \< …

---

## [Processing to read Arduino](https://discourse.processing.org/t/processing-to-read-arduino/31614)

<div class="topic-metadata">

**Author:** [@Kanuta](https://discourse.processing.org/u/Kanuta)\
**Replies:** 7\
**Last updated:** [August 9, 2021, 10:32am UTC](https://discourse.processing.org/t/processing-to-read-arduino/31614 "2021-08-09T10:32:12Z")

</div>

Hello! I am trying to get Processing to read LDR sensor values from Arduino to create moving images but it doesn’t seem to work. Arduino reads the changes fine but Processing keeps showing 0’s and constant numbers. I am…

---

## [Loops using arrays](https://discourse.processing.org/t/loops-using-arrays/30253)

<div class="topic-metadata">

**Author:** [@Kenga123456](https://discourse.processing.org/u/Kenga123456)\
**Replies:** 8\
**Last updated:** [August 9, 2021, 10:13am UTC](https://discourse.processing.org/t/loops-using-arrays/30253 "2021-08-09T10:13:05Z")

</div>

what is wrong with this code? Why does not the ellipses change colors? \< color c\[\]; int x = 0; void setup() { size(400,400); c\[0\]=color(255, 0, 0); // first color c\[1\]=color(0, 255, 0); // second c\[2\]=color(0, 0,…

---

## [Processing online game](https://discourse.processing.org/t/processing-online-game/31639)

<div class="topic-metadata">

**Author:** [@Arsenii237](https://discourse.processing.org/u/Arsenii237)\
**Replies:** 1\
**Last updated:** [August 9, 2021, 8:18am UTC](https://discourse.processing.org/t/processing-online-game/31639 "2021-08-09T08:18:33Z")

</div>

How to make a local game for phones.

---

## [Processing bug - setting A (object) to B (object) and modifying A, it will change B too!](https://discourse.processing.org/t/processing-bug-setting-a-object-to-b-object-and-modifying-a-it-will-change-b-too/31627)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 3\
**Last updated:** [August 8, 2021, 9:07pm UTC](https://discourse.processing.org/t/processing-bug-setting-a-object-to-b-object-and-modifying-a-it-will-change-b-too/31627 "2021-08-08T21:07:31Z")

</div>

Hello everyone! There is an issue with PVectors and objects. If you do this: PVector a = new PVector(0,0); PVector b = new PVector(100,100); PVector c = a; c.lerp(b,0.5); println(a,c); //prints \[ 50.0, 50.0, 0.0 \] \[ 5…

---

## [Editing PShape vertices vs drawing immediate mode](https://discourse.processing.org/t/editing-pshape-vertices-vs-drawing-immediate-mode/31626)

<div class="topic-metadata">

**Author:** [@micuat](https://discourse.processing.org/u/micuat)\
**Replies:** 0\
**Last updated:** [August 8, 2021, 3:59pm UTC](https://discourse.processing.org/t/editing-pshape-vertices-vs-drawing-immediate-mode/31626 "2021-08-08T15:59:31Z")

</div>

I knew that PShape is generally faster than immediate mode (begin/endShape), but I didn’t know if editing PShape vertices before drawing ends up slower or faster than the immediate mode. So I tested it with the following…

---

## [The get() function with width and height not working](https://discourse.processing.org/t/the-get-function-with-width-and-height-not-working/31613)

<div class="topic-metadata">

**Author:** [@paulstgeorge](https://discourse.processing.org/u/paulstgeorge)\
**Replies:** 10\
**Last updated:** [August 8, 2021, 9:28am UTC](https://discourse.processing.org/t/the-get-function-with-width-and-height-not-working/31613 "2021-08-08T09:28:50Z")

</div>

The code is very simple and I am referring to \<https://processing.org/reference/get\_.html\> But when I try to use get(100, 100, 5, 5) I get the error “cannot convert from PImage to int”. Is it me, or the code? PImage im…

---

## [Faster Rendering Techniques in P3D?](https://discourse.processing.org/t/faster-rendering-techniques-in-p3d/31465)

<div class="topic-metadata">

**Author:** [@CosmicCrowMC](https://discourse.processing.org/u/CosmicCrowMC)\
**Replies:** 16\
**Last updated:** [August 7, 2021, 2:37pm UTC](https://discourse.processing.org/t/faster-rendering-techniques-in-p3d/31465 "2021-08-07T14:37:41Z")

</div>

I’ve made a very large 3D game with Processing, and for the past few months, I’ve dealt with pretty shotty performance, considering only 2,000 or so quads are being drawn at any given time. With enough workarounds, I’ve …

---

## [How to add to an ArrayList every x seconds?](https://discourse.processing.org/t/how-to-add-to-an-arraylist-every-x-seconds/31609)

<div class="topic-metadata">

**Author:** [@chaotic.rabbit](https://discourse.processing.org/u/chaotic.rabbit)\
**Replies:** 1\
**Last updated:** [August 7, 2021, 11:29am UTC](https://discourse.processing.org/t/how-to-add-to-an-arraylist-every-x-seconds/31609 "2021-08-07T11:29:14Z")

</div>

void setup(){ jellies = new ArrayList(); for(int i=0; i\<=5; i++){ jellies.add(new Jellyfish(random(0, 800), random(height), random(-40, 40), random(0.05, 0.35))); } for(int i = jellies.size()-1; i\>=0; i–){ Jellyfis…

---

## [Variable inside a string](https://discourse.processing.org/t/variable-inside-a-string/31532)

<div class="topic-metadata">

**Author:** [@MoonAlien822](https://discourse.processing.org/u/MoonAlien822)\
**Replies:** 5\
**Last updated:** [August 4, 2021, 10:50pm UTC](https://discourse.processing.org/t/variable-inside-a-string/31532 "2021-08-04T22:50:02Z")

</div>

I want to make a string that changes depending on the variable so in my example hello and the number would have to touch, so no spaces and the x should be the number that x is Float x; Void draw(){ X=random(30); Print(H…

---

## [For loop matrix index](https://discourse.processing.org/t/for-loop-matrix-index/31508)

<div class="topic-metadata">

**Author:** [@niuuin](https://discourse.processing.org/u/niuuin)\
**Replies:** 14\
**Last updated:** [August 4, 2021, 12:52pm UTC](https://discourse.processing.org/t/for-loop-matrix-index/31508 "2021-08-04T12:52:19Z")

</div>

int total; float itemSize; void setup() { size(800, 800); pixelDensity(2); smooth(); rectMode(CENTER); total = 4; itemSize = width/total; } void draw() { clear(); for (int i = 0; i \< sq(total); i ++) …

---

## [Arithmetic Order of Operation and Calculation](https://discourse.processing.org/t/arithmetic-order-of-operation-and-calculation/31559)

<div class="topic-metadata">

**Author:** [@Peace](https://discourse.processing.org/u/Peace)\
**Replies:** 2\
**Last updated:** [August 4, 2021, 11:11am UTC](https://discourse.processing.org/t/arithmetic-order-of-operation-and-calculation/31559 "2021-08-04T11:11:22Z")

</div>

Hello guys, I am looking for a complete list of how Arithmetic Order of Operation and Calculation operates in Procession. Can anybody please direct me where can I find that information ? Cheers guys :clinking\_glasses:

---

## [GStreamer for recording live video](https://discourse.processing.org/t/gstreamer-for-recording-live-video/31573)

<div class="topic-metadata">

**Author:** [@StainlessHolz](https://discourse.processing.org/u/StainlessHolz)\
**Replies:** 0\
**Last updated:** [August 4, 2021, 9:59am UTC](https://discourse.processing.org/t/gstreamer-for-recording-live-video/31573 "2021-08-04T09:59:34Z")

</div>

Hi everyone, Ive made a sketch witch decodes a full HD h.264 camera livestream, displays it and puts a overlay on it. To this point everything works fine and fast using the P2D renderer. Now i need to record this vide…

---

## [P2D, P3D only show grey screen -- until java window is closed](https://discourse.processing.org/t/p2d-p3d-only-show-grey-screen-until-java-window-is-closed/29370)

<div class="topic-metadata">

**Author:** [@willowisp](https://discourse.processing.org/u/willowisp)\
**Replies:** 8\
**Last updated:** [August 3, 2021, 9:59pm UTC](https://discourse.processing.org/t/p2d-p3d-only-show-grey-screen-until-java-window-is-closed/29370 "2021-08-03T21:59:43Z")

</div>

When I’m trying to use P2D or P3D rendering, only a blank, grey screen is shown. This is the simplest code I could come up with to illustrate the problem: size(200, 200, P2D); background(0); Expected output is a black…

---

## [Null Pointer Exception with Arduino Communication](https://discourse.processing.org/t/null-pointer-exception-with-arduino-communication/31500)

<div class="topic-metadata">

**Author:** [@PapiAli](https://discourse.processing.org/u/PapiAli)\
**Replies:** 19\
**Last updated:** [August 3, 2021, 4:58pm UTC](https://discourse.processing.org/t/null-pointer-exception-with-arduino-communication/31500 "2021-08-03T16:58:40Z")

</div>

So I am running into this issue with my Processing code where I am getting null pointer exceptions whenever it runs over the port.write() line. Just for some background, what I am trying to do is have the Processing cod…

---

## [Zig Zag or Wavy or Spiral or Dotted lines 👀](https://discourse.processing.org/t/zig-zag-or-wavy-or-spiral-or-dotted-lines/31547)

<div class="topic-metadata">

**Author:** [@Peace](https://discourse.processing.org/u/Peace)\
**Replies:** 7\
**Last updated:** [August 3, 2021, 1:38pm UTC](https://discourse.processing.org/t/zig-zag-or-wavy-or-spiral-or-dotted-lines/31547 "2021-08-03T13:38:30Z")

</div>

Hi guys, I am a newbie to Processing ( by the way, I really liked this name, Processing :ok\_hand: ) and I have just learnt to draw vertical, horizons line, rect mode. Just wondering what will be the code for drawing Zig …

---

## [Convert HTML table to JSON](https://discourse.processing.org/t/convert-html-table-to-json/31555)

<div class="topic-metadata">

**Author:** [@Mattyjak](https://discourse.processing.org/u/Mattyjak)\
**Replies:** 1\
**Last updated:** [August 2, 2021, 10:24pm UTC](https://discourse.processing.org/t/convert-html-table-to-json/31555 "2021-08-02T22:24:22Z")

</div>

Hello everybody! Today I’ve been messing around with APIs and one of the few I’ve tried (Pastebin) returns data in the form of an HTML table. I want to convert this table into a JSON object but I’m having some trouble. …

---

## [Trying to make my own version of the "quick draw" game to build a library and teach an AI as a BEGINNER](https://discourse.processing.org/t/trying-to-make-my-own-version-of-the-quick-draw-game-to-build-a-library-and-teach-an-ai-as-a-beginner/30518)

<div class="topic-metadata">

**Author:** [@anntie](https://discourse.processing.org/u/anntie)\
**Replies:** 36\
**Last updated:** [August 2, 2021, 5:29pm UTC](https://discourse.processing.org/t/trying-to-make-my-own-version-of-the-quick-draw-game-to-build-a-library-and-teach-an-ai-as-a-beginner/30518 "2021-08-02T17:29:06Z")

</div>

Hello! I am working on a design project about emotive writing. I would like to teach an AI to detect “emotions” from simple hand-drawn lines, and maybe use a GAN to generate lines according to specified emotional categor…

---

## [Serial Communication / Simulink](https://discourse.processing.org/t/serial-communication-simulink/31516)

<div class="topic-metadata">

**Author:** [@MJAhmadi](https://discourse.processing.org/u/MJAhmadi)\
**Replies:** 2\
**Last updated:** [August 2, 2021, 4:03pm UTC](https://discourse.processing.org/t/serial-communication-simulink/31516 "2021-08-02T16:03:17Z")

</div>

Hi, I want to send some binary data through processing serial to Matlab Simulink Software(serial receive block); I defined header and terminator in Simulink, but i dont know how to define this in processing? my code is…

---

## [Pd4P3 - A new real-time audio synthesis library for Processing](https://discourse.processing.org/t/pd4p3-a-new-real-time-audio-synthesis-library-for-processing/31345)

<div class="topic-metadata">

**Author:** [@robertesler](https://discourse.processing.org/u/robertesler)\
**Replies:** 2\
**Last updated:** [August 2, 2021, 1:58pm UTC](https://discourse.processing.org/t/pd4p3-a-new-real-time-audio-synthesis-library-for-processing/31345 "2021-08-02T13:58:01Z")

</div>

I hope this is a good place to make an announcement like this. I have just recently released a real-time audio synthesis library called “Pd4P3” which stands for “Pd++ for Processing 3”. It is a library based on Pure Da…

---

## [Daylight robbery](https://discourse.processing.org/t/daylight-robbery/26886)

<div class="topic-metadata">

**Author:** [@ekaggrat](https://discourse.processing.org/u/ekaggrat)\
**Replies:** 5\
**Last updated:** [August 2, 2021, 1:14pm UTC](https://discourse.processing.org/t/daylight-robbery/26886 "2021-08-02T13:14:56Z")

</div>

i tried downloading processing 2.2.1 as i need it for my older projects. It just wont allow me to go anywhere without giving a donation. after a lot of tries i finally gave up and gave a 5 dollar minimum donation. inspit…

---

## [Avoiding clicks when changing sinOsc amplitude realtime](https://discourse.processing.org/t/avoiding-clicks-when-changing-sinosc-amplitude-realtime/31520)

<div class="topic-metadata">

**Author:** [@eltrem](https://discourse.processing.org/u/eltrem)\
**Replies:** 5\
**Last updated:** [August 2, 2021, 12:23pm UTC](https://discourse.processing.org/t/avoiding-clicks-when-changing-sinosc-amplitude-realtime/31520 "2021-08-02T12:23:27Z")

</div>

I’m finding some annoying audio glitches when changing a processing.sound sinOsc oscillator amplitude in realtime, for example with the mouse. While moving the mouse, the amplitude step difference is big enough to be he…

[Previous page](https://discourse.processing.org/c/processing/6.md?page=118)

[Next page](https://discourse.processing.org/c/processing/6.md?page=120)
