# Processing

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

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

**Page:** 220

---

## [Can anyone help me shorten my code? or less heavy? (plus how to make a restart button)](https://discourse.processing.org/t/can-anyone-help-me-shorten-my-code-or-less-heavy-plus-how-to-make-a-restart-button/19729)

<div class="topic-metadata">

**Author:** [@haree2000](https://discourse.processing.org/u/haree2000)\
**Replies:** 3\
**Last updated:** [April 15, 2020, 2:55pm UTC](https://discourse.processing.org/t/can-anyone-help-me-shorten-my-code-or-less-heavy-plus-how-to-make-a-restart-button/19729 "2020-04-15T14:55:53Z")

</div>

hey! I’m still really new to processing TT but I’m getting there!! right now I want to make a short interactive story using processing(IDK if that’s a good idea or not but I’m trying!) so I got it down pretty well!! b…

---

## [P3D crashes on start](https://discourse.processing.org/t/p3d-crashes-on-start/2169)

<div class="topic-metadata">

**Author:** [@madbrine](https://discourse.processing.org/u/madbrine)\
**Replies:** 3\
**Last updated:** [April 15, 2020, 10:41am UTC](https://discourse.processing.org/t/p3d-crashes-on-start/2169 "2020-04-15T10:41:28Z")

</div>

I’m trying to work on a project… I ran size(854,480,P3D) and it crashed while loading. Then I took off the P3D and it ran fine… Errors: Nativewindow X11 IOError: Display 0x7fc0f80f3cb0 (:0): Resource temporarily unavail…

---

## [PDF renderer drawing shapes in different order then the Sketch](https://discourse.processing.org/t/pdf-renderer-drawing-shapes-in-different-order-then-the-sketch/19747)

<div class="topic-metadata">

**Author:** [@LuisFerreira](https://discourse.processing.org/u/LuisFerreira)\
**Replies:** 5\
**Last updated:** [April 15, 2020, 9:57am UTC](https://discourse.processing.org/t/pdf-renderer-drawing-shapes-in-different-order-then-the-sketch/19747 "2020-04-15T09:57:06Z")

</div>

Hi everyone, i am having a problem exporting my sketch to PDF. As you can see on the Sketch’s screenshot, everything looks as it should. However the result i get on PDF, the other screenshot, is missing some elements, n…

---

## [Calculator plus sign will not show on the display screen, Any ideas?](https://discourse.processing.org/t/calculator-plus-sign-will-not-show-on-the-display-screen-any-ideas/19790)

<div class="topic-metadata">

**Author:** [@WeeBoEtte](https://discourse.processing.org/u/WeeBoEtte)\
**Replies:** 6\
**Last updated:** [April 15, 2020, 8:31am UTC](https://discourse.processing.org/t/calculator-plus-sign-will-not-show-on-the-display-screen-any-ideas/19790 "2020-04-15T08:31:16Z")

</div>

Hello, I am trying to make a simple calculator in processing, but when I click the plus sign, it does not display, instead, a little box displays. Any ideas? Calculator tab Keypad keyPad; color backgroundC = color(200…

---

## [How to make grids of shapes react differently from each other?](https://discourse.processing.org/t/how-to-make-grids-of-shapes-react-differently-from-each-other/19751)

<div class="topic-metadata">

**Author:** [@358sebastian](https://discourse.processing.org/u/358sebastian)\
**Replies:** 7\
**Last updated:** [April 15, 2020, 7:47am UTC](https://discourse.processing.org/t/how-to-make-grids-of-shapes-react-differently-from-each-other/19751 "2020-04-15T07:47:37Z")

</div>

Hi. I’m wondering how, if possible, to have grids of shapes react to audio in different times from each other? I have grids of Ellipses reacting to an audio input at the exact same time, but I want some Ellipses to rea…

---

## [How would I condense this code into classes, objects etc?](https://discourse.processing.org/t/how-would-i-condense-this-code-into-classes-objects-etc/19791)

<div class="topic-metadata">

**Author:** [@WeeBoEtte](https://discourse.processing.org/u/WeeBoEtte)\
**Replies:** 2\
**Last updated:** [April 15, 2020, 7:25am UTC](https://discourse.processing.org/t/how-would-i-condense-this-code-into-classes-objects-etc/19791 "2020-04-15T07:25:33Z")

</div>

I stumbled across this online, and I want to use it for reference, but it seems really jumbled. Any idea how I can organize this better into objects, classes, etc? color background\_color = color(58, 250, 94); color entr…

---

## [Web parsing through a Harvey Norman](https://discourse.processing.org/t/web-parsing-through-a-harvey-norman/19638)

<div class="topic-metadata">

**Author:** [@Water99](https://discourse.processing.org/u/Water99)\
**Replies:** 2\
**Last updated:** [April 15, 2020, 3:42am UTC](https://discourse.processing.org/t/web-parsing-through-a-harvey-norman/19638 "2020-04-15T03:42:23Z")

</div>

Hello everyone, so I am pretty young and just getting into processing 2 years ago. I am doing this competition where I am planning to do some web scraping/parsing through Harvey Norman’s website. The project needs to be …

---

## [Using defined colors from an array](https://discourse.processing.org/t/using-defined-colors-from-an-array/19781)

<div class="topic-metadata">

**Author:** [@debxyz](https://discourse.processing.org/u/debxyz)\
**Replies:** 12\
**Last updated:** [April 15, 2020, 12:06am UTC](https://discourse.processing.org/t/using-defined-colors-from-an-array/19781 "2020-04-15T00:06:22Z")

</div>

I am trying to figure out how to access the 5 grays in the array randomly to fill() the arc shape and rectangle. Seems like it should be pretty easy to do but… And haven’t been able to find anything in my books or onli…

---

## [How to get the colour of a PShape?](https://discourse.processing.org/t/how-to-get-the-colour-of-a-pshape/19787)

<div class="topic-metadata">

**Author:** [@Cybernet](https://discourse.processing.org/u/Cybernet)\
**Replies:** 1\
**Last updated:** [April 14, 2020, 11:05pm UTC](https://discourse.processing.org/t/how-to-get-the-colour-of-a-pshape/19787 "2020-04-14T23:05:30Z")

</div>

I have a Pshape like this: PShape s; s.setFill(0); if (s colour == color(0)) How do I detect the PShape colour? Do I have to create my own PShape class?

---

## [How to detect if two lines are intersecting?](https://discourse.processing.org/t/how-to-detect-if-two-lines-are-intersecting/19636)

<div class="topic-metadata">

**Author:** [@Cybernet](https://discourse.processing.org/u/Cybernet)\
**Replies:** 7\
**Last updated:** [April 14, 2020, 10:38pm UTC](https://discourse.processing.org/t/how-to-detect-if-two-lines-are-intersecting/19636 "2020-04-14T22:38:16Z")

</div>

So if you have two lines, and they both can be curvy or straight, how do you tell if they are intersecting? Is there a way to do it with colours?

---

## [I have to create a program](https://discourse.processing.org/t/i-have-to-create-a-program/19783)

<div class="topic-metadata">

**Author:** [@mcaaaalvo](https://discourse.processing.org/u/mcaaaalvo)\
**Replies:** 3\
**Last updated:** [April 14, 2020, 10:25pm UTC](https://discourse.processing.org/t/i-have-to-create-a-program/19783 "2020-04-14T22:25:39Z")

</div>

THANKS EVERYONE :smile: :smile: :smile: :smile: :smile: :smile: :smile: :smile: :smile:

---

## [For loop structure for arrays](https://discourse.processing.org/t/for-loop-structure-for-arrays/19250)

<div class="topic-metadata">

**Author:** [@SheCurvesMobius](https://discourse.processing.org/u/SheCurvesMobius)\
**Replies:** 12\
**Last updated:** [April 14, 2020, 10:00pm UTC](https://discourse.processing.org/t/for-loop-structure-for-arrays/19250 "2020-04-14T22:00:42Z")

</div>

Hello, I’m trying to wrap my head around the for loop structure for arrays. Is there a way to assign values to the elements in the array using the array for loop structure: for(int i : arrayName)? I’ve done this but it…

---

## [How to use switch() in a custom function?](https://discourse.processing.org/t/how-to-use-switch-in-a-custom-function/19753)

<div class="topic-metadata">

**Author:** [@codebodger](https://discourse.processing.org/u/codebodger)\
**Replies:** 5\
**Last updated:** [April 14, 2020, 9:40pm UTC](https://discourse.processing.org/t/how-to-use-switch-in-a-custom-function/19753 "2020-04-14T21:40:54Z")

</div>

I need to create a function called tpc, taking in one integer argument, and returning an integer based on a switch function. I have already written the switch function, and it is quite simple. The return function autom…

---

## [Simple ArrayIndex problem](https://discourse.processing.org/t/simple-arrayindex-problem/19434)

<div class="topic-metadata">

**Author:** [@vjjv](https://discourse.processing.org/u/vjjv)\
**Replies:** 8\
**Last updated:** [April 14, 2020, 9:21pm UTC](https://discourse.processing.org/t/simple-arrayindex-problem/19434 "2020-04-14T21:21:20Z")

</div>

Hi! I\`ve a simple problem, but i couldnt find a solution. Im building a function that generate points, and i want to draw a line between those points, building a triangle: float size = 200; ArrayList\<PVector\>positions…

---

## [Make this code better](https://discourse.processing.org/t/make-this-code-better/19770)

<div class="topic-metadata">

**Author:** [@gurki](https://discourse.processing.org/u/gurki)\
**Replies:** 8\
**Last updated:** [April 14, 2020, 7:21pm UTC](https://discourse.processing.org/t/make-this-code-better/19770 "2020-04-14T19:21:28Z")

</div>

Hello again, I made an code for one task of the exam. But it is not 100% correct. Can sameone give me an hint to make this code better? This is the task in the exam ( it is in german); Schreiben Sie zwei Funktionen:…

---

## [Length won't work in a function](https://discourse.processing.org/t/length-wont-work-in-a-function/19780)

<div class="topic-metadata">

**Author:** [@codebodger](https://discourse.processing.org/u/codebodger)\
**Replies:** 2\
**Last updated:** [April 14, 2020, 6:21pm UTC](https://discourse.processing.org/t/length-wont-work-in-a-function/19780 "2020-04-14T18:21:48Z")

</div>

I have a fairly simple custom function. It takes two inputs (an int\[\] and an int) and returns an int\[\]. It takes the length of the int\[\] input, however it gives the error The variable "length" does not exist Here is a…

---

## [Has anyone here ever tried handtracking with a Kinect before?(On macOs)](https://discourse.processing.org/t/has-anyone-here-ever-tried-handtracking-with-a-kinect-before-on-macos/19388)

<div class="topic-metadata">

**Author:** [@farukhcasy2](https://discourse.processing.org/u/farukhcasy2)\
**Replies:** 4\
**Last updated:** [April 14, 2020, 5:04pm UTC](https://discourse.processing.org/t/has-anyone-here-ever-tried-handtracking-with-a-kinect-before-on-macos/19388 "2020-04-14T17:04:48Z")

</div>

Hey there! My name is Sam and I am writing my thesis surrounding the subject of deformable displays and 3D interactions. My setup (at the moment) has a Kinect behind a textile screen that tracks one point on the screen a…

---

## [How to draw a hexagon from a line?](https://discourse.processing.org/t/how-to-draw-a-hexagon-from-a-line/19768)

<div class="topic-metadata">

**Author:** [@Tauter](https://discourse.processing.org/u/Tauter)\
**Replies:** 2\
**Last updated:** [April 14, 2020, 2:15pm UTC](https://discourse.processing.org/t/how-to-draw-a-hexagon-from-a-line/19768 "2020-04-14T14:15:24Z")

</div>

With given 2 point for example: (200,100) and (245,200), how can i make a hexagon out of this ? The hexagon should be drawn to the left side of the line. I can’t figure it out, no matter how i try. I can’t use anything…

---

## [Text seems jittery when moving in a circular pattern](https://discourse.processing.org/t/text-seems-jittery-when-moving-in-a-circular-pattern/19548)

<div class="topic-metadata">

**Author:** [@ottenm](https://discourse.processing.org/u/ottenm)\
**Replies:** 10\
**Last updated:** [April 14, 2020, 7:53am UTC](https://discourse.processing.org/t/text-seems-jittery-when-moving-in-a-circular-pattern/19548 "2020-04-14T07:53:55Z")

</div>

I’m struggling to get an ellipse-with-text moving around the screen smoothly. Is it just me or is the text jittering a lot more than the ellipse? It seems like the ellipse shake is minimal/tolerable, but the text shake…

---

## [Is it possible to run files in the same folder (sketch) separately?](https://discourse.processing.org/t/is-it-possible-to-run-files-in-the-same-folder-sketch-separately/19756)

<div class="topic-metadata">

**Author:** [@codebodger](https://discourse.processing.org/u/codebodger)\
**Replies:** 1\
**Last updated:** [April 13, 2020, 9:43pm UTC](https://discourse.processing.org/t/is-it-possible-to-run-files-in-the-same-folder-sketch-separately/19756 "2020-04-13T21:43:46Z")

</div>

Is it possible to run files in the same folder (sketch) separately? I have two files (\*.pde) in one sketch folder. I need to open them separately and run them separately. Is there a way to do this? If so, what is it? …

---

## [Text box of points Nr. 2](https://discourse.processing.org/t/text-box-of-points-nr-2/19755)

<div class="topic-metadata">

**Author:** [@gurki](https://discourse.processing.org/u/gurki)\
**Replies:** 3\
**Last updated:** [April 13, 2020, 7:23pm UTC](https://discourse.processing.org/t/text-box-of-points-nr-2/19755 "2020-04-13T19:23:15Z")

</div>

Hello again, I have this task. It is in german: Schreiben Sie die FunkQon makeX() mit dem Parameter size. Ihre FunkQon sollte einen (Text-)Kasten der entsprechenden Höhe und Breite zeichnen, bestehend aus Punkten un…

---

## [Text box of points / Textkasten, bestehend aus Punkten](https://discourse.processing.org/t/text-box-of-points-textkasten-bestehend-aus-punkten/19754)

<div class="topic-metadata">

**Author:** [@gurki](https://discourse.processing.org/u/gurki)\
**Replies:** 21\
**Last updated:** [April 13, 2020, 6:59pm UTC](https://discourse.processing.org/t/text-box-of-points-textkasten-bestehend-aus-punkten/19754 "2020-04-13T18:59:14Z")

</div>

The next task is this one (also in german): Schreiben Sie eine Funktion kreuz() mit vier den Parametern: hoehe, breite, zeile, spalte. Ihre Funktion sollte einen (Text-)Kasten der entsprechenden Höhe und Breite zeichne…

---

## [Problem with a boolean in a frogger type project](https://discourse.processing.org/t/problem-with-a-boolean-in-a-frogger-type-project/19704)

<div class="topic-metadata">

**Author:** [@alexWin](https://discourse.processing.org/u/alexWin)\
**Replies:** 6\
**Last updated:** [April 13, 2020, 4:09pm UTC](https://discourse.processing.org/t/problem-with-a-boolean-in-a-frogger-type-project/19704 "2020-04-13T16:09:14Z")

</div>

Hello there, There is Boolean in the Road class (Boolean ok) and I cant figure out what is going on with it. It always set to false and after a few hours of trying to solve it ,I can’t figure out why. I think it might…

---

## [Println the smallest number in the arrays](https://discourse.processing.org/t/println-the-smallest-number-in-the-arrays/19694)

<div class="topic-metadata">

**Author:** [@gurki](https://discourse.processing.org/u/gurki)\
**Replies:** 16\
**Last updated:** [April 13, 2020, 10:39am UTC](https://discourse.processing.org/t/println-the-smallest-number-in-the-arrays/19694 "2020-04-13T10:39:22Z")

</div>

Hello Everyone, I have a problem with this task. The Questin is in german: Schreiben Sie eine FunkQon minAlle(), die zwei Arrays bekommt und die kleinste Zahl aus beiden Arrays zurückgibt. Testen Sie Ihre FunkQon mit …

---

## [Send & Receive data on the same serial port without causing the Arduino program to bug](https://discourse.processing.org/t/send-receive-data-on-the-same-serial-port-without-causing-the-arduino-program-to-bug/19723)

<div class="topic-metadata">

**Author:** [@bking](https://discourse.processing.org/u/bking)\
**Replies:** 1\
**Last updated:** [April 13, 2020, 9:55am UTC](https://discourse.processing.org/t/send-receive-data-on-the-same-serial-port-without-causing-the-arduino-program-to-bug/19723 "2020-04-13T09:55:03Z")

</div>

Hello gentlemen and ladies, It’s more an Arduino question than an Processing one, but it’s a short question :wink: I send data with the serial port from Processing to Arduino and it works very well, I can control 5 st…

---

## [Time based media Question](https://discourse.processing.org/t/time-based-media-question/19731)

<div class="topic-metadata">

**Author:** [@firetryer](https://discourse.processing.org/u/firetryer)\
**Replies:** 1\
**Last updated:** [April 13, 2020, 8:23am UTC](https://discourse.processing.org/t/time-based-media-question/19731 "2020-04-13T08:23:06Z")

</div>

I was wondering how to make a code corresponding to sound. I don’t know how to start

---

## [Get all markers visible at current zoom level (unfolding)](https://discourse.processing.org/t/get-all-markers-visible-at-current-zoom-level-unfolding/18326)

<div class="topic-metadata">

**Author:** [@wcneill](https://discourse.processing.org/u/wcneill)\
**Replies:** 1\
**Last updated:** [April 13, 2020, 6:53am UTC](https://discourse.processing.org/t/get-all-markers-visible-at-current-zoom-level-unfolding/18326 "2020-04-13T06:53:07Z")

</div>

I have a very large set of features that outline city borders. Trying to convert them all to markers and load all onto a map at once seems to be bogging down my app. What I’d like to do instead is only show these city b…

---

## [LOW-HIGH tresholds](https://discourse.processing.org/t/low-high-tresholds/10596)

<div class="topic-metadata">

**Author:** [@rand\_colors](https://discourse.processing.org/u/rand_colors)\
**Replies:** 5\
**Last updated:** [April 30, 2019, 2:34pm UTC](https://discourse.processing.org/t/low-high-tresholds/10596 "2019-04-30T14:34:05Z")

</div>

Hi, I’m trying to make a two thresholds color analisis in a Pimage file. But I can’t understand what I wrote wrong or If I made a conceptual mistake. I’m a bit lost now. for(int i =0; i\<imgOrigin.pixels.length; i++…

---

## [The class Object](https://discourse.processing.org/t/the-class-object/19693)

<div class="topic-metadata">

**Author:** [@Baz](https://discourse.processing.org/u/Baz)\
**Replies:** 10\
**Last updated:** [April 12, 2020, 5:19pm UTC](https://discourse.processing.org/t/the-class-object/19693 "2020-04-12T17:19:07Z")

</div>

I’m trying to write a simple 2D physics simulator. In it, I have 3 classes : One for box, one for circle, and one called manifold which serve for collision detection. Long story short, the manifold class need to have 2 …

---

## [Alternate sort on a bidimensional array](https://discourse.processing.org/t/alternate-sort-on-a-bidimensional-array/19698)

<div class="topic-metadata">

**Author:** [@Quorum](https://discourse.processing.org/u/Quorum)\
**Replies:** 1\
**Last updated:** [April 12, 2020, 2:56pm UTC](https://discourse.processing.org/t/alternate-sort-on-a-bidimensional-array/19698 "2020-04-12T14:56:40Z")

</div>

Hi there :slight\_smile: I’m an absolute beginner in processing and I’ve not found on the references this answer. Can I apply an alternate sort to a bidimensional array? As 0, 1, 0, 1… There is a standard function for …

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

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