# Processing

**URL:** https://discourse.processing.org/c/processing/6.md?no_subcategories=false&page=143

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

**Page:** 144

---

## [Removing PImage mask](https://discourse.processing.org/t/removing-pimage-mask/28620)

<div class="topic-metadata">

**Author:** [@Jean-no](https://discourse.processing.org/u/Jean-no)\
**Replies:** 2\
**Last updated:** [March 17, 2021, 10:33pm UTC](https://discourse.processing.org/t/removing-pimage-mask/28620 "2021-03-17T22:33:03Z")

</div>

Hi ! I wonder if there is a way to remove the alpha mask of a PImage (applied with the PImage.mask() command) or if I just have to apply an int array full of 255…

---

## [Choppy animation when screen sharing over Zoom](https://discourse.processing.org/t/choppy-animation-when-screen-sharing-over-zoom/28619)

<div class="topic-metadata">

**Author:** [@jackeddielove](https://discourse.processing.org/u/jackeddielove)\
**Replies:** 4\
**Last updated:** [March 17, 2021, 9:39pm UTC](https://discourse.processing.org/t/choppy-animation-when-screen-sharing-over-zoom/28619 "2021-03-17T21:39:56Z")

</div>

When I share my screen on a Zoom (or similar) call, the animation is choppy on their end but is running smoothly on my screen. Is this a known issue? Is there a fix?

---

## [Array causing NullPointerException error?](https://discourse.processing.org/t/array-causing-nullpointerexception-error/28614)

<div class="topic-metadata">

**Author:** [@Mattyjak](https://discourse.processing.org/u/Mattyjak)\
**Replies:** 1\
**Last updated:** [March 17, 2021, 4:45pm UTC](https://discourse.processing.org/t/array-causing-nullpointerexception-error/28614 "2021-03-17T16:45:41Z")

</div>

Hello everyone! Today, I’ve decided to start working on my game. I had some old code for player movement that I wanted to see if I could port over, and here it is. Unfortunately, it keeps throwing me a ‘NullPointerExcept…

---

## [Serial port left open when sketch program closed](https://discourse.processing.org/t/serial-port-left-open-when-sketch-program-closed/28592)

<div class="topic-metadata">

**Author:** [@jeffmarc](https://discourse.processing.org/u/jeffmarc)\
**Replies:** 2\
**Last updated:** [March 17, 2021, 11:35am UTC](https://discourse.processing.org/t/serial-port-left-open-when-sketch-program-closed/28592 "2021-03-17T11:35:45Z")

</div>

Serial port opened by sketch is left open . When I try to run sketch again it fails with port busy try - catch exception doesn’t work on re running program to close open port then reopen. Is there a way , other than re…

---

## [Assigning function to a variable](https://discourse.processing.org/t/assigning-function-to-a-variable/28563)

<div class="topic-metadata">

**Author:** [@Mattyjak](https://discourse.processing.org/u/Mattyjak)\
**Replies:** 8\
**Last updated:** [March 17, 2021, 1:13am UTC](https://discourse.processing.org/t/assigning-function-to-a-variable/28563 "2021-03-17T01:13:13Z")

</div>

Hello everybody! I’m a beginner at processing (but I have some experience with p5js and PJs). I’m trying to find a way to assign a function to a variable. Essentially, I want to be able to set a function to a separate v…

---

## [Processing display window looks pixelated on macOS Catalina](https://discourse.processing.org/t/processing-display-window-looks-pixelated-on-macos-catalina/28597)

<div class="topic-metadata">

**Author:** [@Lp0101](https://discourse.processing.org/u/Lp0101)\
**Replies:** 3\
**Last updated:** [March 16, 2021, 11:30pm UTC](https://discourse.processing.org/t/processing-display-window-looks-pixelated-on-macos-catalina/28597 "2021-03-16T23:30:32Z")

</div>

Hey guys! So this weird started happening after I upgraded to Catalina where the display window in Processing started to look pixelated. It happens with all 2D and 3D sketches. I checked with p5.js to see if I was going …

---

## [Can I use the for loop to write 9 rows at the time?](https://discourse.processing.org/t/can-i-use-the-for-loop-to-write-9-rows-at-the-time/28553)

<div class="topic-metadata">

**Author:** [@laptophead](https://discourse.processing.org/u/laptophead)\
**Replies:** 6\
**Last updated:** [March 16, 2021, 5:35pm UTC](https://discourse.processing.org/t/can-i-use-the-for-loop-to-write-9-rows-at-the-time/28553 "2021-03-16T17:35:39Z")

</div>

I am writing to CSV and it goes well, but there is a lot of data I need to generated. So I tried the for loop. But it writes and overwrites on the same first row instead of giving me 9 rows populated with individual da…

---

## [Help with genius game create](https://discourse.processing.org/t/help-with-genius-game-create/28583)

<div class="topic-metadata">

**Author:** [@Leommoraes](https://discourse.processing.org/u/Leommoraes)\
**Replies:** 1\
**Last updated:** [March 16, 2021, 5:03pm UTC](https://discourse.processing.org/t/help-with-genius-game-create/28583 "2021-03-16T17:03:54Z")

</div>

Hi guys, i need to create a game like “genius game”, create a sequence of colors and making levels, for advance a level, the user needs to insert the colors blink in sequence, just like a genius game, can we help me? thi…

---

## [ArrayDeque iterator throws "Concurrent Modification Exception"](https://discourse.processing.org/t/arraydeque-iterator-throws-concurrent-modification-exception/28055)

<div class="topic-metadata">

**Author:** [@mxa](https://discourse.processing.org/u/mxa)\
**Replies:** 4\
**Last updated:** [March 16, 2021, 2:23pm UTC](https://discourse.processing.org/t/arraydeque-iterator-throws-concurrent-modification-exception/28055 "2021-03-16T14:23:43Z")

</div>

I’m sending values from another application (Pure Data) to Processing via OSC. That data is then visualized in Processing by scrolling by bars like a waveform using an ArrayDeque. It seems to run fine, except after a few…

---

## [How do I change the random color for each petal of the flower?](https://discourse.processing.org/t/how-do-i-change-the-random-color-for-each-petal-of-the-flower/28084)

<div class="topic-metadata">

**Author:** [@batmm](https://discourse.processing.org/u/batmm)\
**Replies:** 8\
**Last updated:** [March 16, 2021, 8:27am UTC](https://discourse.processing.org/t/how-do-i-change-the-random-color-for-each-petal-of-the-flower/28084 "2021-03-16T08:27:37Z")

</div>

please format code with \</\> button \* homework policy \* asking questions //The constants needed in the equations for the “rose” final float K = 4; //The factor that controls the number of “petals” final float RATE =…

---

## [How do i make this spiral line change gradient colors?](https://discourse.processing.org/t/how-do-i-make-this-spiral-line-change-gradient-colors/28552)

<div class="topic-metadata">

**Author:** [@cocopuffs](https://discourse.processing.org/u/cocopuffs)\
**Replies:** 5\
**Last updated:** [March 15, 2021, 11:53pm UTC](https://discourse.processing.org/t/how-do-i-make-this-spiral-line-change-gradient-colors/28552 "2021-03-15T23:53:30Z")

</div>

can someone help me with this please?

---

## [A simple data split , what am I doing wrong?](https://discourse.processing.org/t/a-simple-data-split-what-am-i-doing-wrong/28551)

<div class="topic-metadata">

**Author:** [@laptophead](https://discourse.processing.org/u/laptophead)\
**Replies:** 4\
**Last updated:** [March 15, 2021, 9:02pm UTC](https://discourse.processing.org/t/a-simple-data-split-what-am-i-doing-wrong/28551 "2021-03-15T21:02:48Z")

</div>

I am receiving a 2 value string from an arduino delimited by a space. if(serialConnect) { if (myPort.available() \> 0) { IncomingSTR = myPort.readStringUntil(lf); //println (IncomingStr); if (IncomingSTR !=…

---

## [Pass JVM args to exported Windows exe](https://discourse.processing.org/t/pass-jvm-args-to-exported-windows-exe/28546)

<div class="topic-metadata">

**Author:** [@onimatrix](https://discourse.processing.org/u/onimatrix)\
**Replies:** 0\
**Last updated:** [March 15, 2021, 3:23pm UTC](https://discourse.processing.org/t/pass-jvm-args-to-exported-windows-exe/28546 "2021-03-15T15:23:50Z")

</div>

Hello community! I’m working on a tool that’s meant to be as user friendly as possible. It also needs a big chunk of memory. I want to pass Xms and Xmx arguments to the JVM when the user runs the executable (and it ha…

---

## [Chessboard with array pixels](https://discourse.processing.org/t/chessboard-with-array-pixels/28477)

<div class="topic-metadata">

**Author:** [@S1993](https://discourse.processing.org/u/S1993)\
**Replies:** 12\
**Last updated:** [March 15, 2021, 2:40pm UTC](https://discourse.processing.org/t/chessboard-with-array-pixels/28477 "2021-03-15T14:40:05Z")

</div>

I need to code a chessboard making use of array pixels. I can’t use the function rect. I don’t know how to do it. I would appreciate it if you can help me. Thanks.

---

## [How can I make a rectangular collision of an image?](https://discourse.processing.org/t/how-can-i-make-a-rectangular-collision-of-an-image/28538)

<div class="topic-metadata">

**Author:** [@vinijoncrafts](https://discourse.processing.org/u/vinijoncrafts)\
**Replies:** 2\
**Last updated:** [March 15, 2021, 11:53am UTC](https://discourse.processing.org/t/how-can-i-make-a-rectangular-collision-of-an-image/28538 "2021-03-15T11:53:43Z")

</div>

I am having trouble with making an image collide with something The image i use: https://drive.google.com/file/d/1yGA6DMe9KDWJG15VfWLT1DlvyNVDuhCg/view The code: Ship Ship; Obstacles Obstacles; //KeyBinds Keys; PI…

---

## [Texture on hexagon](https://discourse.processing.org/t/texture-on-hexagon/28534)

<div class="topic-metadata">

**Author:** [@Theodor](https://discourse.processing.org/u/Theodor)\
**Replies:** 3\
**Last updated:** [March 15, 2021, 11:39am UTC](https://discourse.processing.org/t/texture-on-hexagon/28534 "2021-03-15T11:39:59Z")

</div>

Hallo I am new in this forum and just started with processing. I would like to paint my 3d hexagon with an image (texture). How can I place a texture on a hexagon? The jpg it self is a rectangular format and I would like…

---

## [Reconfigure - the canvas](https://discourse.processing.org/t/reconfigure-the-canvas/28541)

<div class="topic-metadata">

**Author:** [@Apollo](https://discourse.processing.org/u/Apollo)\
**Replies:** 3\
**Last updated:** [March 15, 2021, 11:34am UTC](https://discourse.processing.org/t/reconfigure-the-canvas/28541 "2021-03-15T11:34:14Z")

</div>

Hi! I hope you could help me here. I got this code. void setup() { size(500, 500); noStroke(); } void draw() { background(0); fill(0,200,0); int t = 0; float z = map(millis(), 0, 20000, 0, 400); for ( i…

---

## [Aiming marbles away from a central point](https://discourse.processing.org/t/aiming-marbles-away-from-a-central-point/28535)

<div class="topic-metadata">

**Author:** [@ottenm](https://discourse.processing.org/u/ottenm)\
**Replies:** 3\
**Last updated:** [March 15, 2021, 11:28am UTC](https://discourse.processing.org/t/aiming-marbles-away-from-a-central-point/28535 "2021-03-15T11:28:23Z")

</div>

I have a sketch that simulates marbles bumping into each other. Each marble has one PVector for ‘location’ and another one for ‘velocity’. location.add(velocity) moves the marble to it’s next location, slowly for small…

---

## [Help creating a Tool to autoformat the code inside the Processing IDE when in Python Mode](https://discourse.processing.org/t/help-creating-a-tool-to-autoformat-the-code-inside-the-processing-ide-when-in-python-mode/27990)

<div class="topic-metadata">

**Author:** [@villares](https://discourse.processing.org/u/villares)\
**Replies:** 2\
**Last updated:** [March 15, 2021, 8:07am UTC](https://discourse.processing.org/t/help-creating-a-tool-to-autoformat-the-code-inside-the-processing-ide-when-in-python-mode/27990 "2021-03-15T08:07:55Z")

</div>

Processing Python mode autoformat (Ctrl + T) has been broken for a long time, and it depends on a socket (?), a local network connection that can often break. I would like someone versed on Eclipse and Processing Tool m…

---

## [Loop through serial ports](https://discourse.processing.org/t/loop-through-serial-ports/28442)

<div class="topic-metadata">

**Author:** [@Konstanitn](https://discourse.processing.org/u/Konstanitn)\
**Replies:** 4\
**Last updated:** [March 15, 2021, 2:23am UTC](https://discourse.processing.org/t/loop-through-serial-ports/28442 "2021-03-15T02:23:07Z")

</div>

Loop through serial ports Hello, I am trying to make a while loop for searching of the right serial port. I get the “RuntimeException: Error opening serial port COM4: Port busy” error probably because the port connecti…

---

## [Error writing to serial: port not opened after already reading from serial](https://discourse.processing.org/t/error-writing-to-serial-port-not-opened-after-already-reading-from-serial/28521)

<div class="topic-metadata">

**Author:** [@junorox](https://discourse.processing.org/u/junorox)\
**Replies:** 3\
**Last updated:** [March 15, 2021, 1:46am UTC](https://discourse.processing.org/t/error-writing-to-serial-port-not-opened-after-already-reading-from-serial/28521 "2021-03-15T01:46:11Z")

</div>

I’m trying to create a code that works with arduino by sending commands back and forth between the two. Processing is receiving commands from arduino easily enough but Processing is giving error “RuntimeException: Error …

---

## [My validation for my rogue-like dungeon generation has gone wrong?](https://discourse.processing.org/t/my-validation-for-my-rogue-like-dungeon-generation-has-gone-wrong/28505)

<div class="topic-metadata">

**Author:** [@ekay](https://discourse.processing.org/u/ekay)\
**Replies:** 2\
**Last updated:** [March 14, 2021, 10:31pm UTC](https://discourse.processing.org/t/my-validation-for-my-rogue-like-dungeon-generation-has-gone-wrong/28505 "2021-03-14T22:31:42Z")

</div>

Hi everyone! I am currently writing a piece of code which randomly generates a cluster of black squares on a grid of white squares, represented using a 2D array. Each number in my code corresponds to a different coloure…

---

## [Need help with slider](https://discourse.processing.org/t/need-help-with-slider/28512)

<div class="topic-metadata">

**Author:** [@Jemo](https://discourse.processing.org/u/Jemo)\
**Replies:** 2\
**Last updated:** [March 14, 2021, 6:25pm UTC](https://discourse.processing.org/t/need-help-with-slider/28512 "2021-03-14T18:25:29Z")

</div>

So I have a slider and it works and all but how do I get the output to be used as a variable? basically when I move the slider it supposed to change the angle of a force but its not working. thanks

---

## [How to show terrain and 3d grid](https://discourse.processing.org/t/how-to-show-terrain-and-3d-grid/28491)

<div class="topic-metadata">

**Author:** [@jafal](https://discourse.processing.org/u/jafal)\
**Replies:** 15\
**Last updated:** [March 14, 2021, 5:52pm UTC](https://discourse.processing.org/t/how-to-show-terrain-and-3d-grid/28491 "2021-03-14T17:52:32Z")

</div>

@Chrisir hi i need some help if you kind i want to add this 3d rects to this sketch int cols, rows; int scl = 26; int w = 2800; int h = 2600; boolean showImage = true; PImage img; void setup() { size(800, 8…

---

## [ArrayIndexOutOfBoundsException: 1024](https://discourse.processing.org/t/arrayindexoutofboundsexception-1024/28522)

<div class="topic-metadata">

**Author:** [@babatnvn](https://discourse.processing.org/u/babatnvn)\
**Replies:** 7\
**Last updated:** [March 14, 2021, 3:24pm UTC](https://discourse.processing.org/t/arrayindexoutofboundsexception-1024/28522 "2021-03-14T15:24:28Z")

</div>

Dear everyone; when I compile a code in the processing. it has an error like this picture. Please how to fix it. Many thanks.!

---

## [Please help me with move my ellipse](https://discourse.processing.org/t/please-help-me-with-move-my-ellipse/28526)

<div class="topic-metadata">

**Author:** [@olia](https://discourse.processing.org/u/olia)\
**Replies:** 6\
**Last updated:** [March 14, 2021, 1:37pm UTC](https://discourse.processing.org/t/please-help-me-with-move-my-ellipse/28526 "2021-03-14T13:37:28Z")

</div>

im not that good in english, sorry. so i have ellipse that moves from the center to the edges. I need it to move back to the center when I click the mouse int rad = 40; // Width of the shape float xpos, ypos; …

---

## [How to draw a curveVertex with color gradient?](https://discourse.processing.org/t/how-to-draw-a-curvevertex-with-color-gradient/28513)

<div class="topic-metadata">

**Author:** [@tea\_tree](https://discourse.processing.org/u/tea_tree)\
**Replies:** 3\
**Last updated:** [March 14, 2021, 11:25am UTC](https://discourse.processing.org/t/how-to-draw-a-curvevertex-with-color-gradient/28513 "2021-03-14T11:25:40Z")

</div>

Drawing a color gradient with a line, even in 3D, is pretty straight-forward: import peasy.\*; PeasyCam cam; void setup() { size(1300, 1300, P3D); cam = new PeasyCam(this, 200); } void draw() { background(255); …

---

## [Troubleshooting global null pointer exception](https://discourse.processing.org/t/troubleshooting-global-null-pointer-exception/28437)

<div class="topic-metadata">

**Author:** [@toby](https://discourse.processing.org/u/toby)\
**Replies:** 4\
**Last updated:** [March 14, 2021, 10:54am UTC](https://discourse.processing.org/t/troubleshooting-global-null-pointer-exception/28437 "2021-03-14T10:54:35Z")

</div>

Hello Processing chums! I have a quite large multi-tab Processing program which is suddenly and unexpectedly failing to startup (I suspect because of a trivial one-character editing accident or something, but due to a d…

---

## [Splitting the String into multiple Arrays and Converting it to an int](https://discourse.processing.org/t/splitting-the-string-into-multiple-arrays-and-converting-it-to-an-int/28502)

<div class="topic-metadata">

**Author:** [@Nick2](https://discourse.processing.org/u/Nick2)\
**Replies:** 3\
**Last updated:** [March 14, 2021, 6:07am UTC](https://discourse.processing.org/t/splitting-the-string-into-multiple-arrays-and-converting-it-to-an-int/28502 "2021-03-14T06:07:39Z")

</div>

Hi I am a bit new to processing and do not really know that much. I managed to display some serial data, but what I really need is a GUI to show the temperature from multiple ds18b20 sensors. but I need some help with Sp…

---

## [How to calculate good-looking bezier control points in 3D?](https://discourse.processing.org/t/how-to-calculate-good-looking-bezier-control-points-in-3d/28504)

<div class="topic-metadata">

**Author:** [@tea\_tree](https://discourse.processing.org/u/tea_tree)\
**Replies:** 6\
**Last updated:** [March 13, 2021, 10:33pm UTC](https://discourse.processing.org/t/how-to-calculate-good-looking-bezier-control-points-in-3d/28504 "2021-03-13T22:33:24Z")

</div>

I’d like to draw Bezier curves algorithmically, i.e. I’d like the control points to be functions of two data points. Assuming the following Bezier curve: I imagine P0, P1, and P2 form an obtuse triangle where the angl…

[Previous page](https://discourse.processing.org/c/processing/6.md?no_subcategories=false&page=142)

[Next page](https://discourse.processing.org/c/processing/6.md?no_subcategories=false&page=144)
