# Coding Questions

**URL:** https://discourse.processing.org/c/processing/processing-questions/15.md?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

---

## [Problem with loadJSONArray example](https://discourse.processing.org/t/problem-with-loadjsonarray-example/10207)

<div class="topic-metadata">

**Author:** [@wprisk](https://discourse.processing.org/u/wprisk)\
**Replies:** 13\
**Last updated:** [April 18, 2019, 12:05am UTC](https://discourse.processing.org/t/problem-with-loadjsonarray-example/10207 "2019-04-18T00:05:29Z")

</div>

Hello, I am trying to run the simple example for “loadJSONArray” found here: https://processing.org/reference/loadJSONArray\_.html When I do so (by copying and pasting into a Processing sketch, and also creating the da…

---

## [Text Rain Processing](https://discourse.processing.org/t/text-rain-processing/10306)

<div class="topic-metadata">

**Author:** [@nothingnew](https://discourse.processing.org/u/nothingnew)\
**Replies:** 7\
**Last updated:** [April 17, 2019, 6:21pm UTC](https://discourse.processing.org/t/text-rain-processing/10306 "2019-04-17T18:21:35Z")

</div>

hello! i am creating random alphabet rain at this moment, but it seems like continuously same position with same alphabets. I want it to be all random! is there any solution for this problem? thanks! String \[\] data =…

---

## [Sequence question](https://discourse.processing.org/t/sequence-question/10365)

<div class="topic-metadata">

**Author:** [@horsemen](https://discourse.processing.org/u/horsemen)\
**Replies:** 3\
**Last updated:** [April 17, 2019, 12:31pm UTC](https://discourse.processing.org/t/sequence-question/10365 "2019-04-17T12:31:58Z")

</div>

The question is the sequence starts with three ones and then every number after that is the sum of the three numbers that precede it. For example: 1 1 1 3 = 1 + 1 + 1 5 = 3 + 1 + 1 9 = 5 + 3 + 1 17 = 9 + 5 + 3 3…

---

## [Import or "translate" a FORTAN code in Processing](https://discourse.processing.org/t/import-or-translate-a-fortan-code-in-processing/9997)

<div class="topic-metadata">

**Author:** [@bking](https://discourse.processing.org/u/bking)\
**Replies:** 7\
**Last updated:** [April 16, 2019, 9:24am UTC](https://discourse.processing.org/t/import-or-translate-a-fortan-code-in-processing/9997 "2019-04-16T09:24:27Z")

</div>

Hi everyones, I’m very interested with the synchronisation of globally coupled oscillators due to wonderful pattern it can make. So, I would like to use the periodic signal of 5 oscillators and see how they synchronise…

---

## [How can I make my circles move slightly?](https://discourse.processing.org/t/how-can-i-make-my-circles-move-slightly/10301)

<div class="topic-metadata">

**Author:** [@dana](https://discourse.processing.org/u/dana)\
**Replies:** 3\
**Last updated:** [April 16, 2019, 9:27pm UTC](https://discourse.processing.org/t/how-can-i-make-my-circles-move-slightly/10301 "2019-04-16T21:27:42Z")

</div>

Okay so I found some code and I’ll like to change it to do something else. Right now there’s a class of circles that appear at random places on the screen, and when the mouse hovers over the screen, the colours of the ci…

---

## [How do I convert processing code so that it'd work on leapmotion?](https://discourse.processing.org/t/how-do-i-convert-processing-code-so-that-itd-work-on-leapmotion/10281)

<div class="topic-metadata">

**Author:** [@cesca](https://discourse.processing.org/u/cesca)\
**Replies:** 2\
**Last updated:** [April 15, 2019, 2:59pm UTC](https://discourse.processing.org/t/how-do-i-convert-processing-code-so-that-itd-work-on-leapmotion/10281 "2019-04-15T14:59:29Z")

</div>

I’m super new to processing and my prof is just as clueless as I am. ArrayList\<Flower\> flowers; void setup() { size(1080, 720); background(190,220,226); frameRate(30); flowers = new ArrayList\<Flower\>(); } //t…

---

## [Function overwriting values outside of its vision](https://discourse.processing.org/t/function-overwriting-values-outside-of-its-vision/10259)

<div class="topic-metadata">

**Author:** [@Feltopi](https://discourse.processing.org/u/Feltopi)\
**Replies:** 11\
**Last updated:** [April 14, 2019, 12:44pm UTC](https://discourse.processing.org/t/function-overwriting-values-outside-of-its-vision/10259 "2019-04-14T12:44:04Z")

</div>

Hello, i have problem with overwriting totaly unrelated values with one function. In my class Populace i create class vector Prihrada\[\] prihrada\_array; and single object Prihrada BIS; Then i run it through my scrip…

---

## [Train move on mouse button, stop once I click again](https://discourse.processing.org/t/train-move-on-mouse-button-stop-once-i-click-again/10256)

<div class="topic-metadata">

**Author:** [@abigail](https://discourse.processing.org/u/abigail)\
**Replies:** 4\
**Last updated:** [April 14, 2019, 10:44am UTC](https://discourse.processing.org/t/train-move-on-mouse-button-stop-once-i-click-again/10256 "2019-04-14T10:44:41Z")

</div>

Hi, I’m making a simple program to make a train move across the screen. At the moment the train moves only when I hold down my mouse button. Would anyone be able to help me make the train move when I press the mouse butt…

---

## [Why is perlin noise looping?](https://discourse.processing.org/t/why-is-perlin-noise-looping/10155)

<div class="topic-metadata">

**Author:** [@happymoep](https://discourse.processing.org/u/happymoep)\
**Replies:** 3\
**Last updated:** [April 13, 2019, 11:11pm UTC](https://discourse.processing.org/t/why-is-perlin-noise-looping/10155 "2019-04-13T23:11:24Z")

</div>

I was playing around with perlin noise and noticed repeating patterns. Having the ability to loop noise with such hardly noticeable seams would be a great feature but shouldn’t be occuring “naturally” here, right? Is t…

---

## [Program BMI - Random Point](https://discourse.processing.org/t/program-bmi-random-point/10230)

<div class="topic-metadata">

**Author:** [@EverybodyEthan](https://discourse.processing.org/u/EverybodyEthan)\
**Replies:** 7\
**Last updated:** [April 13, 2019, 12:20pm UTC](https://discourse.processing.org/t/program-bmi-random-point/10230 "2019-04-13T12:20:54Z")

</div>

Hey guys ! I’m new on the forum and I need help about my final project for exams. I’ve made over 90% of the job and I need few help to finish this. Since 2/3 weeks I’m searching for a way but it continues to be wrong :…

---

## [Help with some fixing up (geometry)](https://discourse.processing.org/t/help-with-some-fixing-up-geometry/10187)

<div class="topic-metadata">

**Author:** [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Replies:** 2\
**Last updated:** [April 13, 2019, 12:19pm UTC](https://discourse.processing.org/t/help-with-some-fixing-up-geometry/10187 "2019-04-13T12:19:31Z")

</div>

Hi, how can i fix this? int np = 20; //num of points float x,y; float xpos\[\]\[\] = new float \[np+2\]\[100\]; float ypos\[\]\[\] = new float \[np+2\]\[100\]; float angle = TWO\_PI/np; float r; int num = 100; void setup() { size(60…

---

## [Problem with Particle and Black hole](https://discourse.processing.org/t/problem-with-particle-and-black-hole/10226)

<div class="topic-metadata">

**Author:** [@techMatt](https://discourse.processing.org/u/techMatt)\
**Replies:** 1\
**Last updated:** [April 13, 2019, 8:04am UTC](https://discourse.processing.org/t/problem-with-particle-and-black-hole/10226 "2019-04-13T08:04:48Z")

</div>

Hello guys. I’m writing a code where a particle is attracted by a black hole. The particle should spiral into the black hole but something strange happens. When the xPos of the Particle is = 250 it begins to move downwar…

---

## [Why does only p2 show up?](https://discourse.processing.org/t/why-does-only-p2-show-up/10217)

<div class="topic-metadata">

**Author:** [@abigail](https://discourse.processing.org/u/abigail)\
**Replies:** 2\
**Last updated:** [April 12, 2019, 6:02pm UTC](https://discourse.processing.org/t/why-does-only-p2-show-up/10217 "2019-04-12T18:02:36Z")

</div>

Hi I’m very new to programming so excuse if this is an easy question, but why is only one of my particles showing up (p2)? Thanks in advance :slight\_smile: Particle p1; Particle p2; void setup() { size(600,400); p…

---

## [How do I save a HIGHSCORE](https://discourse.processing.org/t/how-do-i-save-a-highscore/10201)

<div class="topic-metadata">

**Author:** [@Nolan](https://discourse.processing.org/u/Nolan)\
**Replies:** 2\
**Last updated:** [April 12, 2019, 5:11pm UTC](https://discourse.processing.org/t/how-do-i-save-a-highscore/10201 "2019-04-12T17:11:08Z")

</div>

// Variables int STOP = 1; float count = 0; PImage B1; PImage Background; PImage B2; PImage B3; PImage Start; float x = 0; float x2 = 0; float y = 1080; float y2 = 1080; int Score = 0; int Highscore; float speed = 3; fl…

---

## [Hi guys why my text doesn't show?](https://discourse.processing.org/t/hi-guys-why-my-text-doesnt-show/10075)

<div class="topic-metadata">

**Author:** [@fwtini](https://discourse.processing.org/u/fwtini)\
**Replies:** 13\
**Last updated:** [April 12, 2019, 4:01pm UTC](https://discourse.processing.org/t/hi-guys-why-my-text-doesnt-show/10075 "2019-04-12T16:01:50Z")

</div>

I want to direct the text from left to right and from up to down PFont myFont; String s= "test"; float x=100; float y=100; float speed=0.5; int direction=1; void setup(){ size(700,700); background(255); myFon…

---

## [Rotation 3d text](https://discourse.processing.org/t/rotation-3d-text/10213)

<div class="topic-metadata">

**Author:** [@fwtini](https://discourse.processing.org/u/fwtini)\
**Replies:** 18\
**Last updated:** [April 12, 2019, 4:03pm UTC](https://discourse.processing.org/t/rotation-3d-text/10213 "2019-04-12T16:03:35Z")

</div>

If I want to rotate my text in 360 degrees what parameter can I use? PFont myFont; float rotateVal=0.4; String s1= ("test"); float x,y; float rotateX; float rotateY; int offset =4; float speed = 0.1; float rad…

---

## [Is there something like beginRecord() that works with P2D/texture()?](https://discourse.processing.org/t/is-there-something-like-beginrecord-that-works-with-p2d-texture/10120)

<div class="topic-metadata">

**Author:** [@vielleicht](https://discourse.processing.org/u/vielleicht)\
**Replies:** 1\
**Last updated:** [April 12, 2019, 3:30pm UTC](https://discourse.processing.org/t/is-there-something-like-beginrecord-that-works-with-p2d-texture/10120 "2019-04-12T15:30:48Z")

</div>

I’m creating a kaleidoscope program using texture() to mirror things and then I want to be able to redraw and save everything at a higher resolution. I found a method of redrawing and saving the screen but it uses JAVA2D…

---

## [If I want to show only 1 time my text what can I use?](https://discourse.processing.org/t/if-i-want-to-show-only-1-time-my-text-what-can-i-use/10208)

<div class="topic-metadata">

**Author:** [@fwtini](https://discourse.processing.org/u/fwtini)\
**Replies:** 11\
**Last updated:** [April 12, 2019, 12:42pm UTC](https://discourse.processing.org/t/if-i-want-to-show-only-1-time-my-text-what-can-i-use/10208 "2019-04-12T12:42:08Z")

</div>

PFont myFont; float rotateVal=0.4; String s1= ("test"); float x,y,z; void setup(){ background(255); size(500,500,P3D); myFont = loadFont("Serif-48.vlw"); //frameRate(20); } void draw(){ …

---

## [OpenSimplexNoise is a bit too slow](https://discourse.processing.org/t/opensimplexnoise-is-a-bit-too-slow/10160)

<div class="topic-metadata">

**Author:** [@Kazuya\_Yoshimisu](https://discourse.processing.org/u/Kazuya_Yoshimisu)\
**Replies:** 7\
**Last updated:** [April 11, 2019, 6:30pm UTC](https://discourse.processing.org/t/opensimplexnoise-is-a-bit-too-slow/10160 "2019-04-11T18:30:23Z")

</div>

Hello everyone, I’m currently trying to make an animation using perlin noise. It was too slow so I tried with OpenSimplexNoise and it was better, but still not fast enough. I’m juste looping through 2D slices of 3D noi…

---

## [Smooth close curveVertex shape](https://discourse.processing.org/t/smooth-close-curvevertex-shape/10184)

<div class="topic-metadata">

**Author:** [@lumicon9](https://discourse.processing.org/u/lumicon9)\
**Replies:** 2\
**Last updated:** [April 11, 2019, 2:28pm UTC](https://discourse.processing.org/t/smooth-close-curvevertex-shape/10184 "2019-04-11T14:28:11Z")

</div>

hi, how to smooth close a curveVertex shape, like this: thnx! void setup() { size(200,200); smooth(); noFill(); strokeWeight(1); } void draw() { curves(0,100, 100,0, 200,100, 100,200, 0,100); } void cur…

---

## [Is three keys maximum?](https://discourse.processing.org/t/is-three-keys-maximum/10090)

<div class="topic-metadata">

**Author:** [@lilleGauss](https://discourse.processing.org/u/lilleGauss)\
**Replies:** 5\
**Last updated:** [April 11, 2019, 1:33pm UTC](https://discourse.processing.org/t/is-three-keys-maximum/10090 "2019-04-11T13:33:31Z")

</div>

Hello! I am trying to get keyPressed/keyReleased to work for several keys simultaneously. Every single stroke works and two at the same time too. But nerver for all four of them? Is there somthing with internal handling…

---

## [Questions about gradually lighting up](https://discourse.processing.org/t/questions-about-gradually-lighting-up/10159)

<div class="topic-metadata">

**Author:** [@lqw14520](https://discourse.processing.org/u/lqw14520)\
**Replies:** 3\
**Last updated:** [April 10, 2019, 4:18pm UTC](https://discourse.processing.org/t/questions-about-gradually-lighting-up/10159 "2019-04-10T16:18:42Z")

</div>

Hello! Here is my project of the fireflies that will run away when the mouse is on the left side of the screen, I’m wondering whether there is a way to light each partical (firefly) gradually instead of just suddenly lig…

---

## [How to write into a JSON file via input-box?](https://discourse.processing.org/t/how-to-write-into-a-json-file-via-input-box/10109)

<div class="topic-metadata">

**Author:** [@RealDwayneJ](https://discourse.processing.org/u/RealDwayneJ)\
**Replies:** 9\
**Last updated:** [April 10, 2019, 4:23am UTC](https://discourse.processing.org/t/how-to-write-into-a-json-file-via-input-box/10109 "2019-04-10T04:23:53Z")

</div>

Hi there. I’d like to know the following: Is it possible to save user-input straightly into a specific array position in a JSON file? Example: The user get’s a little screen in Processing. It states the question: “How …

---

## [Interface that has multiple sketches](https://discourse.processing.org/t/interface-that-has-multiple-sketches/10144)

<div class="topic-metadata">

**Author:** [@kaecodes](https://discourse.processing.org/u/kaecodes)\
**Replies:** 1\
**Last updated:** [April 9, 2019, 10:00pm UTC](https://discourse.processing.org/t/interface-that-has-multiple-sketches/10144 "2019-04-09T22:00:09Z")

</div>

Hello, I am new to processing and basically I want to create a user interface where users can interact, that activates different sketches that I have created, using keyboard keys. I am not sure how to put sketches within…

---

## [End and Begin a New Shape Based off of Data Value](https://discourse.processing.org/t/end-and-begin-a-new-shape-based-off-of-data-value/9975)

<div class="topic-metadata">

**Author:** [@kirstee\_baxt](https://discourse.processing.org/u/kirstee_baxt)\
**Replies:** 5\
**Last updated:** [April 9, 2019, 5:58pm UTC](https://discourse.processing.org/t/end-and-begin-a-new-shape-based-off-of-data-value/9975 "2019-04-09T17:58:06Z")

</div>

Hello, I would like to endShape and begin a new one based off a numeric value from a data set. I would like each separate shape to also have a different rotation value based off of the same numeric value. My current cod…

---

## [Help - lines from right to left](https://discourse.processing.org/t/help-lines-from-right-to-left/10129)

<div class="topic-metadata">

**Author:** [@maxwestermann](https://discourse.processing.org/u/maxwestermann)\
**Replies:** 3\
**Last updated:** [April 9, 2019, 3:29pm UTC](https://discourse.processing.org/t/help-lines-from-right-to-left/10129 "2019-04-09T15:29:46Z")

</div>

Hello, I´m new to Processing. What I am trying to do is to create an animation of many black lines (like on the following picture) on a white background going smoothly from left to right in a never ending flow. I man…

---

## [Is there any way to update the camera, rather than create a new one?](https://discourse.processing.org/t/is-there-any-way-to-update-the-camera-rather-than-create-a-new-one/10031)

<div class="topic-metadata">

**Author:** [@Bluu](https://discourse.processing.org/u/Bluu)\
**Replies:** 5\
**Last updated:** [April 8, 2019, 9:50pm UTC](https://discourse.processing.org/t/is-there-any-way-to-update-the-camera-rather-than-create-a-new-one/10031 "2019-04-08T21:50:16Z")

</div>

I was creating a 3-d modeling program and was working on camera controls, when I realized that I couldn’t make a camera system that would just update the camera’s position and other values, rather than just creating a ne…

---

## [How do I make a shape grow?](https://discourse.processing.org/t/how-do-i-make-a-shape-grow/10095)

<div class="topic-metadata">

**Author:** [@cesca](https://discourse.processing.org/u/cesca)\
**Replies:** 3\
**Last updated:** [April 8, 2019, 5:04pm UTC](https://discourse.processing.org/t/how-do-i-make-a-shape-grow/10095 "2019-04-08T17:04:55Z")

</div>

I’m super new to processing. How do I make my flower shape grow or make it look like it’s “blooming”? The size it is now is the max size I want, but how do I make it so it starts from a 0 size to grow into that? void s…

---

## [The shader doesn't have a uniform called "textur](https://discourse.processing.org/t/the-shader-doesnt-have-a-uniform-called-textur/10045)

<div class="topic-metadata">

**Author:** [@clankill3r](https://discourse.processing.org/u/clankill3r)\
**Replies:** 5\
**Last updated:** [April 8, 2019, 10:56am UTC](https://discourse.processing.org/t/the-shader-doesnt-have-a-uniform-called-textur/10045 "2019-04-08T10:56:06Z")

</div>

I have this really simple fragment shader (this is just the starting point…): out vec4 fragColor; uniform sampler2D texture; void main() { fragColor = texture2D(texture, vec2(0.5, 0.5)); } PShader shader; PImage im…

---

## [I need help with a table of dots](https://discourse.processing.org/t/i-need-help-with-a-table-of-dots/10063)

<div class="topic-metadata">

**Author:** [@chaps421](https://discourse.processing.org/u/chaps421)\
**Replies:** 1\
**Last updated:** [April 8, 2019, 4:18am UTC](https://discourse.processing.org/t/i-need-help-with-a-table-of-dots/10063 "2019-04-08T04:18:16Z")

</div>

i want to make a chart of dots with PGraphics but the last colum and row always disapear. i want it to be dinamic and varieate the ise of the grid depending on the size of the window but it always seem to eat the last…

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

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