# Coding Questions

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

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

**Page:** 100

---

## [A Ball bouncing in a rect](https://discourse.processing.org/t/a-ball-bouncing-in-a-rect/19799)

<div class="topic-metadata">

**Author:** [@gurki](https://discourse.processing.org/u/gurki)\
**Replies:** 5\
**Last updated:** [April 15, 2020, 8:37pm UTC](https://discourse.processing.org/t/a-ball-bouncing-in-a-rect/19799 "2020-04-15T20:37:59Z")

</div>

Hello Guys, This is my next taks where I need help; Schreiben Sie ein Programm mit einem 100x100 Fenster mit einem Ball (Durchmesser 20) in einem Rechteck(Position20,10 - Breite 60, Höhe 80). Verwenden Sie noFill() fü…

---

## [Rotating Vectors around different points](https://discourse.processing.org/t/rotating-vectors-around-different-points/19807)

<div class="topic-metadata">

**Author:** [@Kport1](https://discourse.processing.org/u/Kport1)\
**Replies:** 4\
**Last updated:** [April 15, 2020, 6:22pm UTC](https://discourse.processing.org/t/rotating-vectors-around-different-points/19807 "2020-04-15T18:22:03Z")

</div>

Im trying to make a visualizaztion I saw in one of 3blue1brown videos The code below is supposed to rotate two vectors (x,y and mpos.x, mpos.y) around another vector (dx,dy). I wrote my own function, because the built i…

---

## [Create a table of values](https://discourse.processing.org/t/create-a-table-of-values/19796)

<div class="topic-metadata">

**Author:** [@marethyu](https://discourse.processing.org/u/marethyu)\
**Replies:** 11\
**Last updated:** [April 15, 2020, 5:04pm UTC](https://discourse.processing.org/t/create-a-table-of-values/19796 "2020-04-15T17:04:22Z")

</div>

Hi, now I’m working on a mini project which require creating a table of possible value, then use these values to calculate and draw the graph. I have try the most ‘brutal’ way which uses just the function text(), but wh…

---

## [Having problem using saveTable() in void draw()](https://discourse.processing.org/t/having-problem-using-savetable-in-void-draw/19801)

<div class="topic-metadata">

**Author:** [@abdullahmq](https://discourse.processing.org/u/abdullahmq)\
**Replies:** 2\
**Last updated:** [April 15, 2020, 4:13pm UTC](https://discourse.processing.org/t/having-problem-using-savetable-in-void-draw/19801 "2020-04-15T16:13:25Z")

</div>

I am using the dist() function on collision between two objects and I want to record the data after every collision but when I use saveTable() in void draw() my program starts to hangs. When I used a timer and saved the…

---

## [Uncap frameRate in Processing 3](https://discourse.processing.org/t/uncap-framerate-in-processing-3/19805)

<div class="topic-metadata">

**Author:** [@henrylang](https://discourse.processing.org/u/henrylang)\
**Replies:** 2\
**Last updated:** [April 15, 2020, 3:42pm UTC](https://discourse.processing.org/t/uncap-framerate-in-processing-3/19805 "2020-04-15T15:42:24Z")

</div>

Hello, I am making a prototype for drifty car physics, and I though it would be cool to be able to uncap the framerate of the sketch. When using frameRate(1000);, I get over 400 FPS, but it speeds up all of the objects a…

---

## [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…

---

## [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 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 …

---

## [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:

---

## [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…

---

## [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…

---

## [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 …

---

## [Repetitive code](https://discourse.processing.org/t/repetitive-code/19659)

<div class="topic-metadata">

**Author:** [@Quorum](https://discourse.processing.org/u/Quorum)\
**Replies:** 4\
**Last updated:** [April 12, 2020, 2:32pm UTC](https://discourse.processing.org/t/repetitive-code/19659 "2020-04-12T14:32:34Z")

</div>

Good morning everyone, I just started using processing. I’m drawing a sketch where I’m going to create 30 little balls. There’s a way to make them appear in sequence without writing 30 times the same line with the ell…

---

## [Write a two-dimensional array (matrix) to text files?](https://discourse.processing.org/t/write-a-two-dimensional-array-matrix-to-text-files/19674)

<div class="topic-metadata">

**Author:** [@ardano](https://discourse.processing.org/u/ardano)\
**Replies:** 3\
**Last updated:** [April 12, 2020, 2:30pm UTC](https://discourse.processing.org/t/write-a-two-dimensional-array-matrix-to-text-files/19674 "2020-04-12T14:30:13Z")

</div>

Hi everyone! I am an absolute beginner in Processing. I’m trying to figuring how to write a 12x12 two-dimensional array of integers to a .txt file but I don’t have any idea… Can someone please suggest me how? The ful…

---

## [TextureSphere with Text](https://discourse.processing.org/t/texturesphere-with-text/19543)

<div class="topic-metadata">

**Author:** [@paturn](https://discourse.processing.org/u/paturn)\
**Replies:** 18\
**Last updated:** [April 12, 2020, 11:04am UTC](https://discourse.processing.org/t/texturesphere-with-text/19543 "2020-04-12T11:04:51Z")

</div>

I am using Gillian Ramsay’s version of textureSphere and I would like to add text to interact with the operation of the program. However, when the sphere is rotated or translated, it also rotates or translates the text …

---

## [How can I have Perlin Noise take shape from an image?](https://discourse.processing.org/t/how-can-i-have-perlin-noise-take-shape-from-an-image/19663)

<div class="topic-metadata">

**Author:** [@BogginJunior](https://discourse.processing.org/u/BogginJunior)\
**Replies:** 4\
**Last updated:** [April 12, 2020, 3:12am UTC](https://discourse.processing.org/t/how-can-i-have-perlin-noise-take-shape-from-an-image/19663 "2020-04-12T03:12:23Z")

</div>

Hi everyone! I hope you are all well, considering the circumstances. I am a Graphic Designer and have just begun exploring Generative Art and Processing. I’ve watched tutorials about Perlin Noise, which is beautiful on…

---

## [Tangent line of curve](https://discourse.processing.org/t/tangent-line-of-curve/19600)

<div class="topic-metadata">

**Author:** [@Martaf2001](https://discourse.processing.org/u/Martaf2001)\
**Replies:** 2\
**Last updated:** [April 11, 2020, 9:57pm UTC](https://discourse.processing.org/t/tangent-line-of-curve/19600 "2020-04-11T21:57:16Z")

</div>

Hi everyone!!! I’m new at coding and I have a problem, I would like to draw a program where there is a bicorn curve and every time the mouse is on the curve, it can be generated a tangent line, so on infinite points, bu…

---

## [How to not display blank fields from a csv file?](https://discourse.processing.org/t/how-to-not-display-blank-fields-from-a-csv-file/19668)

<div class="topic-metadata">

**Author:** [@Stage1](https://discourse.processing.org/u/Stage1)\
**Replies:** 1\
**Last updated:** [April 11, 2020, 6:20pm UTC](https://discourse.processing.org/t/how-to-not-display-blank-fields-from-a-csv-file/19668 "2020-04-11T18:20:36Z")

</div>

Hello im currently plotting shapes on my 2d image whilst using the coordinates of longitude and latitude. However, i’ve got some blank fields which i do not want to appear on my image and when they are kept blank they st…

---

## [How can I make a regular triangle from a line?](https://discourse.processing.org/t/how-can-i-make-a-regular-triangle-from-a-line/19655)

<div class="topic-metadata">

**Author:** [@Tauter](https://discourse.processing.org/u/Tauter)\
**Replies:** 10\
**Last updated:** [April 11, 2020, 3:17pm UTC](https://discourse.processing.org/t/how-can-i-make-a-regular-triangle-from-a-line/19655 "2020-04-11T15:17:43Z")

</div>

I have to create a regular triangle from a line. i calculated the middle of the line but after this I can’t figure it out. (szR is a line drawing algorithm) What should be the line end ? int x1,x2,y1,y2,xl,yl; void …

---

## [Processing 3 Escaping Regex Characters](https://discourse.processing.org/t/processing-3-escaping-regex-characters/19477)

<div class="topic-metadata">

**Author:** [@Conor98](https://discourse.processing.org/u/Conor98)\
**Replies:** 3\
**Last updated:** [April 11, 2020, 3:12pm UTC](https://discourse.processing.org/t/processing-3-escaping-regex-characters/19477 "2020-04-11T15:12:10Z")

</div>

I’m currently using the Regex .matches("") command Processing 3 to make an ipv4 address format verifier. I’ve currently got it working with the seperate sets of numbers but my problem is with the ‘.’ symbol. The ‘.’ sy…

---

## [I have a rectangle which is bouncing on the screen. I want it to occur in 8 steps instead of being continuous](https://discourse.processing.org/t/i-have-a-rectangle-which-is-bouncing-on-the-screen-i-want-it-to-occur-in-8-steps-instead-of-being-continuous/19626)

<div class="topic-metadata">

**Author:** [@bellievr](https://discourse.processing.org/u/bellievr)\
**Replies:** 16\
**Last updated:** [April 11, 2020, 12:18pm UTC](https://discourse.processing.org/t/i-have-a-rectangle-which-is-bouncing-on-the-screen-i-want-it-to-occur-in-8-steps-instead-of-being-continuous/19626 "2020-04-11T12:18:09Z")

</div>

Please help me with this question!!!

---

## [How do you make a 3d bar clickable to display a message?](https://discourse.processing.org/t/how-do-you-make-a-3d-bar-clickable-to-display-a-message/19641)

<div class="topic-metadata">

**Author:** [@Stage1](https://discourse.processing.org/u/Stage1)\
**Replies:** 3\
**Last updated:** [April 10, 2020, 8:16pm UTC](https://discourse.processing.org/t/how-do-you-make-a-3d-bar-clickable-to-display-a-message/19641 "2020-04-10T20:16:54Z")

</div>

Hello, i have a 3D bar and i would like to make it clickable. I’ve created the 3d bar using pushmatrix() function and i would like to know how i can make it to display message once its clicked. Here’s an example code. b…

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

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