# Processing

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

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

**Page:** 105

---

## [Text following a sine wave pattern](https://discourse.processing.org/t/text-following-a-sine-wave-pattern/33453)

<div class="topic-metadata">

**Author:** [@clintonva32](https://discourse.processing.org/u/clintonva32)\
**Replies:** 3\
**Last updated:** [November 11, 2021, 11:02am UTC](https://discourse.processing.org/t/text-following-a-sine-wave-pattern/33453 "2021-11-11T11:02:20Z")

</div>

Hi. Trying to get some help with this code. Pretty much want to have each letter in the string be a part of a sine wave. Any idea how to do this? My code seems to be stacking each letter on top of each other. Might be th…

---

## [My side scroller has a problem finding where the ground is](https://discourse.processing.org/t/my-side-scroller-has-a-problem-finding-where-the-ground-is/33444)

<div class="topic-metadata">

**Author:** [@DividedRabbit](https://discourse.processing.org/u/DividedRabbit)\
**Replies:** 4\
**Last updated:** [November 11, 2021, 6:41am UTC](https://discourse.processing.org/t/my-side-scroller-has-a-problem-finding-where-the-ground-is/33444 "2021-11-11T06:41:16Z")

</div>

https://drive.google.com/drive/folders/1qZGnHtEltQCCeqCsDzOSHIyZKUQMSOJt?usp=sharing Here is the drive with all of my code. I am trying to use a linear equation to determine the height of the ground, but for some reason…

---

## [Getting yellow color despite only entering one value on fill()](https://discourse.processing.org/t/getting-yellow-color-despite-only-entering-one-value-on-fill/33446)

<div class="topic-metadata">

**Author:** [@Kenga123456](https://discourse.processing.org/u/Kenga123456)\
**Replies:** 3\
**Last updated:** [November 10, 2021, 8:43pm UTC](https://discourse.processing.org/t/getting-yellow-color-despite-only-entering-one-value-on-fill/33446 "2021-11-10T20:43:10Z")

</div>

int x = 10; int y = 10; int spacingX = 10; int spacingY = 10; void setup() { size(500, 500); } void draw () { background(255); for (int x = 0; x \< width; x = x + spacingX) { for (int y = 0; y \< height; y = y + sp…

---

## [Grid of rectangles produces weird triangle pattern](https://discourse.processing.org/t/grid-of-rectangles-produces-weird-triangle-pattern/33432)

<div class="topic-metadata">

**Author:** [@UnusualUsual](https://discourse.processing.org/u/UnusualUsual)\
**Replies:** 3\
**Last updated:** [November 10, 2021, 5:29pm UTC](https://discourse.processing.org/t/grid-of-rectangles-produces-weird-triangle-pattern/33432 "2021-11-10T17:29:55Z")

</div>

I’m creating a grid of black rectangles on a white background and for some reason unknown to me, part of some rectangles are split and pushed up a pixel to make a weird triangle looking thing in the middle of the grid. …

---

## [Ball Collision with Box: Booleans](https://discourse.processing.org/t/ball-collision-with-box-booleans/33392)

<div class="topic-metadata">

**Author:** [@Chels](https://discourse.processing.org/u/Chels)\
**Replies:** 1\
**Last updated:** [November 8, 2021, 8:09am UTC](https://discourse.processing.org/t/ball-collision-with-box-booleans/33392 "2021-11-08T08:09:27Z")

</div>

So I have my ball restarting on the left once it collides to the right side of the screen. I added a red square in the center of the screen and I want the color of the square to change green when the ball touches the squ…

---

## [How to set the frequency of loaddata requests](https://discourse.processing.org/t/how-to-set-the-frequency-of-loaddata-requests/33442)

<div class="topic-metadata">

**Author:** [@Arabesque0210](https://discourse.processing.org/u/Arabesque0210)\
**Replies:** 0\
**Last updated:** [November 10, 2021, 2:48pm UTC](https://discourse.processing.org/t/how-to-set-the-frequency-of-loaddata-requests/33442 "2021-11-10T14:48:49Z")

</div>

Hi, I am still exploring this interesting code, but I met this problem today. I tried to use API to get real-time wind data from a website, but the free plan only allows me to request data 500 times a day. So I was won…

---

## [Can't run Processing](https://discourse.processing.org/t/cant-run-processing/33294)

<div class="topic-metadata">

**Author:** [@yalaniv](https://discourse.processing.org/u/yalaniv)\
**Replies:** 1\
**Last updated:** [November 10, 2021, 5:55am UTC](https://discourse.processing.org/t/cant-run-processing/33294 "2021-11-10T05:55:41Z")

</div>

Recently I had to replace my Hdd, so I had to download processing again. Since then, I cannot run it, because it only shows the small black intro screen for a second, and it shut down. Any ideas?

---

## [Getting a gradient RGB line using lerp](https://discourse.processing.org/t/getting-a-gradient-rgb-line-using-lerp/33424)

<div class="topic-metadata">

**Author:** [@endymion](https://discourse.processing.org/u/endymion)\
**Replies:** 1\
**Last updated:** [November 9, 2021, 8:51pm UTC](https://discourse.processing.org/t/getting-a-gradient-rgb-line-using-lerp/33424 "2021-11-09T20:51:11Z")

</div>

So I found some code that used lerp to create a gradient between black and white and I modified it to create a gradient between red and blue, but I’d like it to span the whole RGB spectrum: void gradient\_line( color s, …

---

## [G4P Library : GTextField text alignment](https://discourse.processing.org/t/g4p-library-gtextfield-text-alignment/33319)

<div class="topic-metadata">

**Author:** [@R2processing](https://discourse.processing.org/u/R2processing)\
**Replies:** 2\
**Last updated:** [November 9, 2021, 5:07am UTC](https://discourse.processing.org/t/g4p-library-gtextfield-text-alignment/33319 "2021-11-09T05:07:54Z")

</div>

Hello, I’m using the useful G4P library. using txfTEST = new GTextField(this, 10, 20, 70, 20); txfTEST.setText(strTEST); pnlCtrl.addControl(txfTEST); allows me to define a GTextField object in the panel but the te…

---

## [IndexOutOfBoundsException](https://discourse.processing.org/t/indexoutofboundsexception/12499)

<div class="topic-metadata">

**Author:** [@bu.aus](https://discourse.processing.org/u/bu.aus)\
**Replies:** 3\
**Last updated:** [November 9, 2021, 1:19am UTC](https://discourse.processing.org/t/indexoutofboundsexception/12499 "2021-11-09T01:19:43Z")

</div>

Hello, i copied a very simple code from the website,https://processing.org/reference/libraries/sound/SoundFile.html but turns out the problem:IndexOutOfBoundsException .I’ve checked that the file is in the data folder. …

---

## [Size only accepts literals not expressions 4 beta](https://discourse.processing.org/t/size-only-accepts-literals-not-expressions-4-beta/33372)

<div class="topic-metadata">

**Author:** [@seanc4s](https://discourse.processing.org/u/seanc4s)\
**Replies:** 4\
**Last updated:** [November 9, 2021, 12:12am UTC](https://discourse.processing.org/t/size-only-accepts-literals-not-expressions-4-beta/33372 "2021-11-09T00:12:15Z")

</div>

float\[\] data=new float\[50000\]; void setup(){ size(300\*3,300); background(0); for(int i=0;i\<50000;i++){ data\[i\]=randomGaussian(); } for(int i=0;i\<50000;i+=2){ int x=150+int(50f\*data\[i\]); int y=150+in…

---

## [Serial data from Arduino to Processing does not update](https://discourse.processing.org/t/serial-data-from-arduino-to-processing-does-not-update/33378)

<div class="topic-metadata">

**Author:** [@BerndKoggel](https://discourse.processing.org/u/BerndKoggel)\
**Replies:** 4\
**Last updated:** [November 8, 2021, 3:07pm UTC](https://discourse.processing.org/t/serial-data-from-arduino-to-processing-does-not-update/33378 "2021-11-08T15:07:27Z")

</div>

I have an arduino test wether two wires touch, this works. The data is stored in an array for each pin and given either a 1 or 0 if the wire connects to another. The Serial.print is used to send the data, the serial moni…

---

## [Drag & Drop PGraphics](https://discourse.processing.org/t/drag-drop-pgraphics/33396)

<div class="topic-metadata">

**Author:** [@rism](https://discourse.processing.org/u/rism)\
**Replies:** 2\
**Last updated:** [November 8, 2021, 2:48pm UTC](https://discourse.processing.org/t/drag-drop-pgraphics/33396 "2021-11-08T14:48:45Z")

</div>

Hi, I am trying to move the square to another position but it forms a streak of squares instead when dragged. Here is what I have so far: PGraphics squares; float bx; float by; boolean locked = false; float xOffset …

---

## [Why are two rects displayed](https://discourse.processing.org/t/why-are-two-rects-displayed/33393)

<div class="topic-metadata">

**Author:** [@MoonAlien822](https://discourse.processing.org/u/MoonAlien822)\
**Replies:** 1\
**Last updated:** [November 8, 2021, 1:36pm UTC](https://discourse.processing.org/t/why-are-two-rects-displayed/33393 "2021-11-08T13:36:43Z")

</div>

when i press on the kill icon, two rects are displayed when only one should

---

## [Webcam capture and PGraphics](https://discourse.processing.org/t/webcam-capture-and-pgraphics/33389)

<div class="topic-metadata">

**Author:** [@mario60](https://discourse.processing.org/u/mario60)\
**Replies:** 3\
**Last updated:** [November 8, 2021, 1:09pm UTC](https://discourse.processing.org/t/webcam-capture-and-pgraphics/33389 "2021-11-08T13:09:58Z")

</div>

import processing.video.\*; Capture cam; PGraphics pg1; void setup() { size(950, 950); frameRate(10); pg1 = createGraphics(475, 475); String\[\] cameras = Capture.list(); if (cameras.length == 0) { pr…

---

## [Casting 3d to 2d](https://discourse.processing.org/t/casting-3d-to-2d/33185)

<div class="topic-metadata">

**Author:** [@Infi](https://discourse.processing.org/u/Infi)\
**Replies:** 8\
**Last updated:** [November 8, 2021, 12:30pm UTC](https://discourse.processing.org/t/casting-3d-to-2d/33185 "2021-11-08T12:30:20Z")

</div>

Hello, I am searching for a method of casting a loaded 3d object into 2d image, similarly to 2D Topographical Map - #2 by solub Although i would need, instead of height contours, a full 2d image, where gray-scale repre…

---

## [Can I rotate PGraphics by its center axis?](https://discourse.processing.org/t/can-i-rotate-pgraphics-by-its-center-axis/33398)

<div class="topic-metadata">

**Author:** [@Skycstls](https://discourse.processing.org/u/Skycstls)\
**Replies:** 1\
**Last updated:** [November 8, 2021, 12:16pm UTC](https://discourse.processing.org/t/can-i-rotate-pgraphics-by-its-center-axis/33398 "2021-11-08T12:16:02Z")

</div>

Hello processing forum! I have this little code working, it starts by creating a few PGraphics on an array like this: void shapesCreation(int nShapes) { shapes = new PGraphics\[nShapes\]; for (int i = 0; i \< shapes.l…

---

## [Displaying movie in Processing not working!?](https://discourse.processing.org/t/displaying-movie-in-processing-not-working/33179)

<div class="topic-metadata">

**Author:** [@xeronimo](https://discourse.processing.org/u/xeronimo)\
**Replies:** 2\
**Last updated:** [November 8, 2021, 8:55am UTC](https://discourse.processing.org/t/displaying-movie-in-processing-not-working/33179 "2021-11-08T08:55:54Z")

</div>

Hi, I’m trying to import a movie into my sketch using the movie library. It used to work in the past but now it doesn’t … it crashes in P2D and P3D, and in the normal mode it shows the video in a distorted way It’s an…

---

## [Efficiency of code with 100+ objects](https://discourse.processing.org/t/efficiency-of-code-with-100-objects/33236)

<div class="topic-metadata">

**Author:** [@tribblesontoast](https://discourse.processing.org/u/tribblesontoast)\
**Replies:** 5\
**Last updated:** [November 8, 2021, 3:28am UTC](https://discourse.processing.org/t/efficiency-of-code-with-100-objects/33236 "2021-11-08T03:28:02Z")

</div>

Hi all, I’m writing a program that has numerous moving objects on screen and my frame rate starts to take a serious hit at around 100 - 110 objects. I’ve seen programs with thousands running easily so clearly I’m writi…

---

## [Math doesn't work?](https://discourse.processing.org/t/math-doesnt-work/33384)

<div class="topic-metadata">

**Author:** [@stefanmz7](https://discourse.processing.org/u/stefanmz7)\
**Replies:** 11\
**Last updated:** [November 8, 2021, 1:24am UTC](https://discourse.processing.org/t/math-doesnt-work/33384 "2021-11-08T01:24:48Z")

</div>

Hey so why when I do location.y-brick1.y ,location 1 is positive brick1 is -500 it gives out a negative number? Like location.y–500 is location.y +500 so that’s positive. Do math rules not apply in processing?

---

## [Creating a word carpet by rotating and positioning a word a mulitple times](https://discourse.processing.org/t/creating-a-word-carpet-by-rotating-and-positioning-a-word-a-mulitple-times/33153)

<div class="topic-metadata">

**Author:** [@ontherun](https://discourse.processing.org/u/ontherun)\
**Replies:** 7\
**Last updated:** [November 8, 2021, 12:26am UTC](https://discourse.processing.org/t/creating-a-word-carpet-by-rotating-and-positioning-a-word-a-mulitple-times/33153 "2021-11-08T00:26:30Z")

</div>

Hi dear community, Im quite new into processing, but seeing more and more the advantages for generative design aspects and experiments. So for an analog project I would try out the digital dummy. As written in the head…

---

## [Ball Moving Along the Screen Similar to the Game Pong](https://discourse.processing.org/t/ball-moving-along-the-screen-similar-to-the-game-pong/33388)

<div class="topic-metadata">

**Author:** [@Chels](https://discourse.processing.org/u/Chels)\
**Replies:** 2\
**Last updated:** [November 7, 2021, 9:36pm UTC](https://discourse.processing.org/t/ball-moving-along-the-screen-similar-to-the-game-pong/33388 "2021-11-07T21:36:59Z")

</div>

I’m fairly new to processing. So I searched up the Coding Train channel on YouTube and changed a bit of a code to not have the bouncing ball get cut out the window when it runs. Source: https://www.youtube.com/watch?v=Y…

---

## [Struggling to create a gradient](https://discourse.processing.org/t/struggling-to-create-a-gradient/33355)

<div class="topic-metadata">

**Author:** [@bcabc](https://discourse.processing.org/u/bcabc)\
**Replies:** 4\
**Last updated:** [November 7, 2021, 7:07pm UTC](https://discourse.processing.org/t/struggling-to-create-a-gradient/33355 "2021-11-07T19:07:41Z")

</div>

hi there - i am looking to include gradients in my processing drawings. i am generating svg images, so i believe the P2D renderer isn’t for me. i’d also like to apply the gradients to large shapes made out of bezier cu…

---

## [Connecting Perlin noise waves](https://discourse.processing.org/t/connecting-perlin-noise-waves/33359)

<div class="topic-metadata">

**Author:** [@basielcole](https://discourse.processing.org/u/basielcole)\
**Replies:** 2\
**Last updated:** [November 7, 2021, 12:21pm UTC](https://discourse.processing.org/t/connecting-perlin-noise-waves/33359 "2021-11-07T12:21:32Z")

</div>

Hi everyone, I have been trying to connect two or more waves generated with the noise() function. The idea is to get one continuous wave with specific areas having more/less noise added to them. Is there a simple way to …

---

## [Insert a path into a flowfield](https://discourse.processing.org/t/insert-a-path-into-a-flowfield/33334)

<div class="topic-metadata">

**Author:** [@sigbjorn](https://discourse.processing.org/u/sigbjorn)\
**Replies:** 0\
**Last updated:** [November 5, 2021, 1:26pm UTC](https://discourse.processing.org/t/insert-a-path-into-a-flowfield/33334 "2021-11-05T13:26:35Z")

</div>

Hi I have an art project for my class. For this I would like to insert a path function to a flowfield. I feel like im almost done, but cant seem to place the last puzzle. For mye work I have been using the Coding trai…

---

## [Pixelflow optical flow questions](https://discourse.processing.org/t/pixelflow-optical-flow-questions/33332)

<div class="topic-metadata">

**Author:** [@jimjimmer](https://discourse.processing.org/u/jimjimmer)\
**Replies:** 0\
**Last updated:** [November 5, 2021, 11:39am UTC](https://discourse.processing.org/t/pixelflow-optical-flow-questions/33332 "2021-11-05T11:39:14Z")

</div>

/\*\* \* \* PixelFlow | Copyright (C) 2017 Thomas Diewald - www.thomasdiewald.com \* \* https://github.com/diwi/PixelFlow.git \* \* A Processing/Java library for high performance GPU-Computing. \* MIT License: https://o…

---

## [USB Authentication System](https://discourse.processing.org/t/usb-authentication-system/33366)

<div class="topic-metadata">

**Author:** [@TechMaster04](https://discourse.processing.org/u/TechMaster04)\
**Replies:** 0\
**Last updated:** [November 6, 2021, 7:19pm UTC](https://discourse.processing.org/t/usb-authentication-system/33366 "2021-11-06T19:19:44Z")

</div>

Hello all, I’ve been working a program that allows queues to be synced across the network. As an extension to this program, I created an administrator mode that can be accessed by pressing a certain button combination (…

---

## [How to de-register a running thread in Processing](https://discourse.processing.org/t/how-to-de-register-a-running-thread-in-processing/33337)

<div class="topic-metadata">

**Author:** [@avong](https://discourse.processing.org/u/avong)\
**Replies:** 2\
**Last updated:** [November 6, 2021, 6:11am UTC](https://discourse.processing.org/t/how-to-de-register-a-running-thread-in-processing/33337 "2021-11-06T06:11:12Z")

</div>

Permit me to ask once again. I have read and understand how to register thread using the "thread( " “)” function. but, in all the tutorials, i did not see where i can stop a running thread. is there any helping hand? …

---

## [Erase a rectangle](https://discourse.processing.org/t/erase-a-rectangle/33352)

<div class="topic-metadata">

**Author:** [@stefanmz7](https://discourse.processing.org/u/stefanmz7)\
**Replies:** 8\
**Last updated:** [November 6, 2021, 2:54am UTC](https://discourse.processing.org/t/erase-a-rectangle/33352 "2021-11-06T02:54:54Z")

</div>

Hey so can I erase a shape after drawing it? For example I want to have a circle and a rectangle and when they collide the rectangle is erased,it’s just gone out of the program. So how do I do the erasing? I got the othe…

---

## [Resize rectangle](https://discourse.processing.org/t/resize-rectangle/33343)

<div class="topic-metadata">

**Author:** [@stefanmz7](https://discourse.processing.org/u/stefanmz7)\
**Replies:** 3\
**Last updated:** [November 5, 2021, 6:47pm UTC](https://discourse.processing.org/t/resize-rectangle/33343 "2021-11-05T18:47:24Z")

</div>

Hey,so I need to resize a rectangle when a condition is met. Can I do this? Is there a way to resize a rectangle that is drawn in the draw method() after the fact in an if statement? If something is true then resize the …

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

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