# Coding Questions

**URL:** https://discourse.processing.org/c/processing/processing-questions/15.md?page=2

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

**Page:** 3

---

## [Help with smoothly connecting two circles](https://discourse.processing.org/t/help-with-smoothly-connecting-two-circles/46549)

<div class="topic-metadata">

**Author:** [@arkwl](https://discourse.processing.org/u/arkwl)\
**Replies:** 5\
**Last updated:** [June 16, 2025, 10:33pm UTC](https://discourse.processing.org/t/help-with-smoothly-connecting-two-circles/46549 "2025-06-16T22:33:51Z")

</div>

Hello! My goal is to write a function that can organically connect two circles no matter the distance. I originally tried metaballs but found they don’t connect at large distances without increasing the threshold (which …

---

## [Transparent Background/Window with Opaque Objects](https://discourse.processing.org/t/transparent-background-window-with-opaque-objects/46502)

<div class="topic-metadata">

**Author:** [@YellowGTM](https://discourse.processing.org/u/YellowGTM)\
**Replies:** 7\
**Last updated:** [June 5, 2025, 11:37am UTC](https://discourse.processing.org/t/transparent-background-window-with-opaque-objects/46502 "2025-06-05T11:37:30Z")

</div>

Hello Everyone, Long time, no write. I’m attempting to write some code that utilizes a transparent window/background, but need opaque objects to be imposed over the Desktop image. This code works for the transparent …

---

## [Zagged line of a rectangle created by lines](https://discourse.processing.org/t/zagged-line-of-a-rectangle-created-by-lines/46486)

<div class="topic-metadata">

**Author:** [@Kylle](https://discourse.processing.org/u/Kylle)\
**Replies:** 4\
**Last updated:** [May 30, 2025, 2:16pm UTC](https://discourse.processing.org/t/zagged-line-of-a-rectangle-created-by-lines/46486 "2025-05-30T14:16:08Z")

</div>

Hi I am creating a drawing using lines that make up a piece of art. The problem boils down to the fact that a set of parallel lines that should fill a rectangle does not match the performance or the rect() function. I …

---

## [Array of PImages](https://discourse.processing.org/t/array-of-pimages/46444)

<div class="topic-metadata">

**Author:** [@nikapm](https://discourse.processing.org/u/nikapm)\
**Replies:** 4\
**Last updated:** [May 27, 2025, 12:10am UTC](https://discourse.processing.org/t/array-of-pimages/46444 "2025-05-27T00:10:03Z")

</div>

Hello, i am trying to build an array of images to be displayed i looping, but I receive the error message that image cannot be solve as variable. Here’s code: int maxImages = 10; int imageIndex = 0; PImage\[\] images = …

---

## [Drawing a flower of life with 6 Vesica Piscis](https://discourse.processing.org/t/drawing-a-flower-of-life-with-6-vesica-piscis/46341)

<div class="topic-metadata">

**Author:** [@mortap](https://discourse.processing.org/u/mortap)\
**Replies:** 12\
**Last updated:** [May 24, 2025, 1:30am UTC](https://discourse.processing.org/t/drawing-a-flower-of-life-with-6-vesica-piscis/46341 "2025-05-24T01:30:25Z")

</div>

I’m having trouble getting this to draw the shape nicely. I have one function that evenly draws six petals, rotating them around, and one function to draw a single petal. The issue is not apparent when there is noStroke,…

---

## ["Brightness pixels" example too small](https://discourse.processing.org/t/brightness-pixels-example-too-small/46438)

<div class="topic-metadata">

**Author:** [@nikapm](https://discourse.processing.org/u/nikapm)\
**Replies:** 4\
**Last updated:** [May 25, 2025, 2:51am UTC](https://discourse.processing.org/t/brightness-pixels-example-too-small/46438 "2025-05-25T02:51:26Z")

</div>

I am new to processing and I am testing a code from the processing examples about brightness pixels. It works, but the image is much smaller than the window and I don’t know how to fix it. It cover the whole width with t…

---

## [How to count the number of digits of a floating number?](https://discourse.processing.org/t/how-to-count-the-number-of-digits-of-a-floating-number/36980)

<div class="topic-metadata">

**Author:** [@juanjoc](https://discourse.processing.org/u/juanjoc)\
**Replies:** 17\
**Last updated:** [May 19, 2025, 8:46pm UTC](https://discourse.processing.org/t/how-to-count-the-number-of-digits-of-a-floating-number/36980 "2025-05-19T20:46:39Z")

</div>

Hello guys, I am a little confused about the following. I need to get the number of floating digits of a float number. So I have for example the number: 12.345678 And I know that the number of int digits are 2 with …

---

## [Help please: exec() fails with posix\_spawn error](https://discourse.processing.org/t/help-please-exec-fails-with-posix-spawn-error/46374)

<div class="topic-metadata">

**Author:** [@AndrewS](https://discourse.processing.org/u/AndrewS)\
**Replies:** 8\
**Last updated:** [May 13, 2025, 5:54am UTC](https://discourse.processing.org/t/help-please-exec-fails-with-posix-spawn-error/46374 "2025-05-13T05:54:54Z")

</div>

Modernising some code that currently runs slowly on a 2014 mac mini (Yosemite, Processing 3.5.4) to run on a 2017 iMac (Ventura, Processing 4.4.1). Calls to ‘exec()’ work on the 2014 machine and a 2017 Macbook Pro (Ventu…

---

## [SVG Export Issue transform="scale(2,2)"](https://discourse.processing.org/t/svg-export-issue-transform-scale-2-2/46350)

<div class="topic-metadata">

**Author:** [@helaine.b](https://discourse.processing.org/u/helaine.b)\
**Replies:** 3\
**Last updated:** [May 8, 2025, 5:35pm UTC](https://discourse.processing.org/t/svg-export-issue-transform-scale-2-2/46350 "2025-05-08T17:35:17Z")

</div>

After updating to Processing 4.4.3 yesterday (necessary to be able to run via command line on a mac) I’m finding that SVG exports have a tag transform="scale(2,2)" that results in the SVG contents scaling up and the boun…

---

## [Beginner help -- zoom and pan -- drawing tool](https://discourse.processing.org/t/beginner-help-zoom-and-pan-drawing-tool/46302)

<div class="topic-metadata">

**Author:** [@marlss7](https://discourse.processing.org/u/marlss7)\
**Replies:** 3\
**Last updated:** [April 30, 2025, 8:00pm UTC](https://discourse.processing.org/t/beginner-help-zoom-and-pan-drawing-tool/46302 "2025-04-30T20:00:17Z")

</div>

hello, i am new to processing and have a somewhat basic question. i want this incredibly simple drawing tool where you can toggle a pixel on or off by pressing. HOWEVER, since the pixels are then so small, i want to have…

---

## [Issue with resizing image](https://discourse.processing.org/t/issue-with-resizing-image/46271)

<div class="topic-metadata">

**Author:** [@IRIGIMA](https://discourse.processing.org/u/IRIGIMA)\
**Replies:** 12\
**Last updated:** [April 28, 2025, 7:33am UTC](https://discourse.processing.org/t/issue-with-resizing-image/46271 "2025-04-28T07:33:18Z")

</div>

Require urgent help! What am I doing wrong?? Maths is correct, but… Overview: To display a source image (example 15000 X 5000 PX) on 1920 X 1080 destination output. (keeping the correct aspect for destination) Due to…

---

## [How do I make a button class call a function from inside or outside class](https://discourse.processing.org/t/how-do-i-make-a-button-class-call-a-function-from-inside-or-outside-class/46268)

<div class="topic-metadata">

**Author:** [@ggomez](https://discourse.processing.org/u/ggomez)\
**Replies:** 2\
**Last updated:** [April 24, 2025, 5:53am UTC](https://discourse.processing.org/t/how-do-i-make-a-button-class-call-a-function-from-inside-or-outside-class/46268 "2025-04-24T05:53:53Z")

</div>

So I think my question is very simple but I lack the vocabulary to google it myself effectively, thing is, I’m creating a custom Button class and I need to call custom code when instantiating it. I tried using mehod() bu…

---

## [How to use swing components with Processing (3.3.6)](https://discourse.processing.org/t/how-to-use-swing-components-with-processing-3-3-6/36219)

<div class="topic-metadata">

**Author:** [@NumericPrime](https://discourse.processing.org/u/NumericPrime)\
**Replies:** 8\
**Last updated:** [April 23, 2025, 9:00am UTC](https://discourse.processing.org/t/how-to-use-swing-components-with-processing-3-3-6/36219 "2025-04-23T09:00:28Z")

</div>

I tried to add swing components to my projects for a long time as you can easily construct user interfaces with swing and use them to manipulate my program. After a long time I managed to combine the two. Here is a examp…

---

## [Output to multiple displays](https://discourse.processing.org/t/output-to-multiple-displays/43852)

<div class="topic-metadata">

**Author:** [@jstarbell](https://discourse.processing.org/u/jstarbell)\
**Replies:** 3\
**Last updated:** [April 14, 2025, 1:00am UTC](https://discourse.processing.org/t/output-to-multiple-displays/43852 "2025-04-14T01:00:29Z")

</div>

Hi, first post in a decade! I would like to send differing output to two different displays, each in fullScreen mode. I’m running Processing 4.2 For example, on a Windows computer with a monitor and a projector as disp…

---

## [Flocking simulation is erratic and choppy](https://discourse.processing.org/t/flocking-simulation-is-erratic-and-choppy/45958)

<div class="topic-metadata">

**Author:** [@David1](https://discourse.processing.org/u/David1)\
**Replies:** 8\
**Last updated:** [March 27, 2025, 3:26pm UTC](https://discourse.processing.org/t/flocking-simulation-is-erratic-and-choppy/45958 "2025-03-27T15:26:40Z")

</div>

Hi all, I appreciate your time in reading this question. I’m fairly new to Processing and have finally made it into the world of vectors. It’s been funs so far, but I’m having trouble implementing the vectors in a 3D fl…

---

## [Running Processing in Headless Mode (On a Mac)](https://discourse.processing.org/t/running-processing-in-headless-mode-on-a-mac/3457)

<div class="topic-metadata">

**Author:** [@rsomani95](https://discourse.processing.org/u/rsomani95)\
**Replies:** 9\
**Last updated:** [March 31, 2025, 6:03am UTC](https://discourse.processing.org/t/running-processing-in-headless-mode-on-a-mac/3457 "2025-03-31T06:03:39Z")

</div>

I want to run Processing sketches from the terminal, and not have a display window show up. Currently, I can run processing from the terminal using the processing-java command and save my files where I’d like to. Howev…

---

## [How to combine mouse clicks in 3D and processing to be able to click on items in 3D to switch interfaces](https://discourse.processing.org/t/how-to-combine-mouse-clicks-in-3d-and-processing-to-be-able-to-click-on-items-in-3d-to-switch-interfaces/46036)

<div class="topic-metadata">

**Author:** [@camelia](https://discourse.processing.org/u/camelia)\
**Replies:** 2\
**Last updated:** [March 20, 2025, 3:05pm UTC](https://discourse.processing.org/t/how-to-combine-mouse-clicks-in-3d-and-processing-to-be-able-to-click-on-items-in-3d-to-switch-interfaces/46036 "2025-03-20T15:05:48Z")

</div>

How to combine mouse clicks in 3D and processing to be able to click on items in 3D to switch interfaces, I need to do a 3D scan of the room and can click on the items in the room, but I don’t know how to use mouse clic…

---

## [Arrayindexoutofboundsexception: 55 Error, no idea what's gone wrong](https://discourse.processing.org/t/arrayindexoutofboundsexception-55-error-no-idea-whats-gone-wrong/2799)

<div class="topic-metadata">

**Author:** [@12345](https://discourse.processing.org/u/12345)\
**Replies:** 4\
**Last updated:** [March 15, 2025, 2:38pm UTC](https://discourse.processing.org/t/arrayindexoutofboundsexception-55-error-no-idea-whats-gone-wrong/2799 "2025-03-15T14:38:35Z")

</div>

Hi, does anyone know how to fix this error, my sketch works when I use a different svg file but not on other svg files. I can’t work out what might be causing this? This is the error that comes up : arrayindexoutofbounds…

---

## [Artwork recreation Edoardo Lanzi](https://discourse.processing.org/t/artwork-recreation-edoardo-lanzi/45979)

<div class="topic-metadata">

**Author:** [@maumanto16](https://discourse.processing.org/u/maumanto16)\
**Replies:** 5\
**Last updated:** [March 13, 2025, 2:16pm UTC](https://discourse.processing.org/t/artwork-recreation-edoardo-lanzi/45979 "2025-03-13T14:16:18Z")

</div>

How would you go about recreating this artwork in processing? (or a similar one on concept) I’ve been squeezing my brain around it but can’t find a good solution. Can somebody help me?

---

## [How to lock the resolution in JAVA2D rendering environment](https://discourse.processing.org/t/how-to-lock-the-resolution-in-java2d-rendering-environment/45936)

<div class="topic-metadata">

**Author:** [@cola](https://discourse.processing.org/u/cola)\
**Replies:** 1\
**Last updated:** [March 9, 2025, 10:03am UTC](https://discourse.processing.org/t/how-to-lock-the-resolution-in-java2d-rendering-environment/45936 "2025-03-09T10:03:44Z")

</div>

Hello everyone! I am doing resolution adaptation in the JAVA2D environment, hoping that the UI interface will be distorted when switching screens. How to lock the resolution in JAVA2D rendering environment？ Thanks! publ…

---

## [Creating a Vector-Based "Texture" and filling a shape](https://discourse.processing.org/t/creating-a-vector-based-texture-and-filling-a-shape/45911)

<div class="topic-metadata">

**Author:** [@revived](https://discourse.processing.org/u/revived)\
**Replies:** 7\
**Last updated:** [March 7, 2025, 11:12am UTC](https://discourse.processing.org/t/creating-a-vector-based-texture-and-filling-a-shape/45911 "2025-03-07T11:12:35Z")

</div>

Hi all - I’d like to create an SVG file of an arbitrarily-sided polygon that is filled with triangles (or other drawings, potentially.). I have no idea how to do this in Processing or if it is even possible. I was hop…

---

## [How to create a buffer to send JSON data to the server quantitatively](https://discourse.processing.org/t/how-to-create-a-buffer-to-send-json-data-to-the-server-quantitatively/45848)

<div class="topic-metadata">

**Author:** [@cola](https://discourse.processing.org/u/cola)\
**Replies:** 0\
**Last updated:** [February 27, 2025, 1:20pm UTC](https://discourse.processing.org/t/how-to-create-a-buffer-to-send-json-data-to-the-server-quantitatively/45848 "2025-02-27T13:20:32Z")

</div>

Hello,everyone！I want to create a buffer to store ecg\<2384\>,emg\<2384\> data, each time only storing 2 channels and 384 data points, and once enough data points are obtained, send the data in json format to the server. The…

---

## [Concept for moving in a direction for ship in game asteroids](https://discourse.processing.org/t/concept-for-moving-in-a-direction-for-ship-in-game-asteroids/20456)

<div class="topic-metadata">

**Author:** [@Arsenii](https://discourse.processing.org/u/Arsenii)\
**Replies:** 9\
**Last updated:** [February 27, 2025, 8:15pm UTC](https://discourse.processing.org/t/concept-for-moving-in-a-direction-for-ship-in-game-asteroids/20456 "2025-02-27T20:15:53Z")

</div>

I want to recreate asteroids game but don’t know how to program ship moving in the direction of it’s aim.

---

## [Tint function not working on image](https://discourse.processing.org/t/tint-function-not-working-on-image/45763)

<div class="topic-metadata">

**Author:** [@crendon](https://discourse.processing.org/u/crendon)\
**Replies:** 7\
**Last updated:** [February 15, 2025, 10:08pm UTC](https://discourse.processing.org/t/tint-function-not-working-on-image/45763 "2025-02-15T22:08:14Z")

</div>

Hello everyone! Brand new here. :slight\_smile: I am doing the DVD Logo bounce on screen. Everything works except the changing of the color of the image. The image is a PNG. No matter what I try it just stays black. T…

---

## [Why does .getConstructor fail with a NoSuchMethodException despite zero-arg constructors existing for the class?](https://discourse.processing.org/t/why-does-getconstructor-fail-with-a-nosuchmethodexception-despite-zero-arg-constructors-existing-for-the-class/45748)

<div class="topic-metadata">

**Author:** [@PeterAmbos](https://discourse.processing.org/u/PeterAmbos)\
**Replies:** 10\
**Last updated:** [February 12, 2025, 7:43pm UTC](https://discourse.processing.org/t/why-does-getconstructor-fail-with-a-nosuchmethodexception-despite-zero-arg-constructors-existing-for-the-class/45748 "2025-02-12T19:43:33Z")

</div>

I’m programming a game for a programming course in college, and I’ve run into some trouble with the .getConstructor method. What I’m trying to do is pass a class that has to be a subclass of another class as an argument …

---

## [3D scene without any shading](https://discourse.processing.org/t/3d-scene-without-any-shading/45716)

<div class="topic-metadata">

**Author:** [@qualidat](https://discourse.processing.org/u/qualidat)\
**Replies:** 2\
**Last updated:** [February 9, 2025, 1:58pm UTC](https://discourse.processing.org/t/3d-scene-without-any-shading/45716 "2025-02-09T13:58:43Z")

</div>

Hello, I need the objects in a rotating 3d scene without light and shadow, only with solid “smooth” colors. The idea is to use the touchscreen to select individual objects in the rotating scene, even if they cover each o…

---

## [How can I check if a line is touching a specific point?](https://discourse.processing.org/t/how-can-i-check-if-a-line-is-touching-a-specific-point/45725)

<div class="topic-metadata">

**Author:** [@Sel](https://discourse.processing.org/u/Sel)\
**Replies:** 1\
**Last updated:** [February 7, 2025, 11:49pm UTC](https://discourse.processing.org/t/how-can-i-check-if-a-line-is-touching-a-specific-point/45725 "2025-02-07T23:49:33Z")

</div>

How can i check if a line is touching a specific point?

---

## [Perlin noise range does not go all the way from 0.0 - 1.0](https://discourse.processing.org/t/perlin-noise-range-does-not-go-all-the-way-from-0-0-1-0/45722)

<div class="topic-metadata">

**Author:** [@TomToad](https://discourse.processing.org/u/TomToad)\
**Replies:** 1\
**Last updated:** [February 7, 2025, 11:08am UTC](https://discourse.processing.org/t/perlin-noise-range-does-not-go-all-the-way-from-0-0-1-0/45722 "2025-02-07T11:08:22Z")

</div>

I realize that the noise() function won’t go all the way to 1.0, but I’d think that it would at least get as high as 0.999, but it only reaches around 0.846, and it only goes down to about 0.0735. That means when I’m pl…

---

## [Generative collage error](https://discourse.processing.org/t/generative-collage-error/45714)

<div class="topic-metadata">

**Author:** [@jbanales](https://discourse.processing.org/u/jbanales)\
**Replies:** 9\
**Last updated:** [February 7, 2025, 9:41am UTC](https://discourse.processing.org/t/generative-collage-error/45714 "2025-02-07T09:41:42Z")

</div>

Hello, when I run this code I get this message. There are only 16 images in the sketch and they are in the data/images folder. loading… 32images loaded! The file data/images/.\_04.jpg contains bad image data, or may not …

---

## [Reinforcement learning Java Processing](https://discourse.processing.org/t/reinforcement-learning-java-processing/45680)

<div class="topic-metadata">

**Author:** [@ctremblay](https://discourse.processing.org/u/ctremblay)\
**Replies:** 1\
**Last updated:** [January 31, 2025, 10:23pm UTC](https://discourse.processing.org/t/reinforcement-learning-java-processing/45680 "2025-01-31T22:23:08Z")

</div>

OK, I’m trying to make a fun ai challenge between a bunch of different types of learning, but when I try to code Qlearning I am running into trouble. It will just sit still and do nothing. here is sketch int s = 25; //…

[Previous page](https://discourse.processing.org/c/processing/processing-questions/15.md?page=1)

[Next page](https://discourse.processing.org/c/processing/processing-questions/15.md?page=3)
