# Coding Questions

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

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

**Page:** 175

---

## [Flip along the x-axis](https://discourse.processing.org/t/flip-along-the-x-axis/3543)

<div class="topic-metadata">

**Author:** [@rsomani95](https://discourse.processing.org/u/rsomani95)\
**Replies:** 4\
**Last updated:** [September 16, 2018, 2:46pm UTC](https://discourse.processing.org/t/flip-along-the-x-axis/3543 "2018-09-16T14:46:54Z")

</div>

Here’s some code I’m using to generate a color wheel (you can copy-paste this into your PDE and it should run just fine): void setup() { size(500, 500); noStroke(); background(255); colorMode(HSB, 360, 100, 100…

---

## [Use saveStrings to add timestamp INTO the text File](https://discourse.processing.org/t/use-savestrings-to-add-timestamp-into-the-text-file/3573)

<div class="topic-metadata">

**Author:** [@losferatos](https://discourse.processing.org/u/losferatos)\
**Replies:** 3\
**Last updated:** [September 16, 2018, 2:15pm UTC](https://discourse.processing.org/t/use-savestrings-to-add-timestamp-into-the-text-file/3573 "2018-09-16T14:15:08Z")

</div>

Hi guys! I’m trying to create a certain code generator and it works quite well. Cliffs: It generates a number of codes and saves them into a .txt file. Now I also want to add a specific string to the end of that file …

---

## [PVector transformation](https://discourse.processing.org/t/pvector-transformation/3575)

<div class="topic-metadata">

**Author:** [@Ben1](https://discourse.processing.org/u/Ben1)\
**Replies:** 3\
**Last updated:** [September 16, 2018, 1:46pm UTC](https://discourse.processing.org/t/pvector-transformation/3575 "2018-09-16T13:46:53Z")

</div>

Hello there, in a recent tutorial of “the coding train” with Daniel Shiffman I was learning about PVector. In the video (https://www.youtube.com/watch?v=7nTLzLf7jUg) he transforms a simple bouncing ball sketch with vari…

---

## [Right-to-left text](https://discourse.processing.org/t/right-to-left-text/3527)

<div class="topic-metadata">

**Author:** [@Miguel](https://discourse.processing.org/u/Miguel)\
**Replies:** 9\
**Last updated:** [September 14, 2018, 3:37pm UTC](https://discourse.processing.org/t/right-to-left-text/3527 "2018-09-14T15:37:15Z")

</div>

Hey folks, long time no see. I’ve been away from processing for a while but now I’ve opened it again for a small project: I am trying to render some Persian text within processing. The text looks fine when the result is …

---

## [Having trouble getting triangle to speed up?](https://discourse.processing.org/t/having-trouble-getting-triangle-to-speed-up/3532)

<div class="topic-metadata">

**Author:** [@ant](https://discourse.processing.org/u/ant)\
**Replies:** 9\
**Last updated:** [September 14, 2018, 2:17pm UTC](https://discourse.processing.org/t/having-trouble-getting-triangle-to-speed-up/3532 "2018-09-14T14:17:08Z")

</div>

I’m trying to get the triangle to speed up after it hits the wall, but I’m unsure how to do that. //variables float xa=30;float ya=75;float xb=58;float yb=20; float xc=86;float yc=75;float xSpeed=10;float ySpeed=10; vo…

---

## [How to change chance of heads or tails in a coin flip](https://discourse.processing.org/t/how-to-change-chance-of-heads-or-tails-in-a-coin-flip/3531)

<div class="topic-metadata">

**Author:** [@ant](https://discourse.processing.org/u/ant)\
**Replies:** 2\
**Last updated:** [September 14, 2018, 12:46pm UTC](https://discourse.processing.org/t/how-to-change-chance-of-heads-or-tails-in-a-coin-flip/3531 "2018-09-14T12:46:20Z")

</div>

I know this is the code for getting twice the number of heads and I’m trying different things out to rig a coin flip. if (random(1)\< (1/3)) { image (tail, mouseX, mouseY); } else { image (head,mouseX,mouseY); …

---

## [Code generated pattern wrap on 3D](https://discourse.processing.org/t/code-generated-pattern-wrap-on-3d/3385)

<div class="topic-metadata">

**Author:** [@vallu](https://discourse.processing.org/u/vallu)\
**Replies:** 13\
**Last updated:** [September 13, 2018, 6:40pm UTC](https://discourse.processing.org/t/code-generated-pattern-wrap-on-3d/3385 "2018-09-13T18:40:46Z")

</div>

Hello, I have been to trying to program a cuboid with surfaces rendered in code generated patterns (image attached). While there is a texture function for wrapping images, I couldn’t find anything for SVG’s or code gener…

---

## [How to remove array object when mouse pressed](https://discourse.processing.org/t/how-to-remove-array-object-when-mouse-pressed/3406)

<div class="topic-metadata">

**Author:** [@tefa](https://discourse.processing.org/u/tefa)\
**Replies:** 17\
**Last updated:** [September 13, 2018, 7:19am UTC](https://discourse.processing.org/t/how-to-remove-array-object-when-mouse-pressed/3406 "2018-09-13T07:19:43Z")

</div>

Hello Dear Processors, thank you for your time. So I am trying to remove images from an array when mouseX and mouseY is directly in top of the image. how do i do that. So fare I have the code that detects when the mouse …

---

## [Saving data coming in quicker that draw() can run](https://discourse.processing.org/t/saving-data-coming-in-quicker-that-draw-can-run/3353)

<div class="topic-metadata">

**Author:** [@Tglaser92](https://discourse.processing.org/u/Tglaser92)\
**Replies:** 3\
**Last updated:** [September 12, 2018, 5:43pm UTC](https://discourse.processing.org/t/saving-data-coming-in-quicker-that-draw-can-run/3353 "2018-09-12T17:43:58Z")

</div>

Hello all, I’ve got data coming into a serial port at 250Hz and I’d like to save it all to a .csv file. Of course draw() is not going to be able to keep up with that rate of data. Is there a way to save all incoming da…

---

## [Platform game: take away a life](https://discourse.processing.org/t/platform-game-take-away-a-life/3478)

<div class="topic-metadata">

**Author:** [@Processingn00b](https://discourse.processing.org/u/Processingn00b)\
**Replies:** 5\
**Last updated:** [September 12, 2018, 4:40pm UTC](https://discourse.processing.org/t/platform-game-take-away-a-life/3478 "2018-09-12T16:40:10Z")

</div>

Hello, me again. i am still making my game and was wondering if someone could help me. i am trying to make it when the bottom platform touches the falling rectangles it will take away a life (three lives) but i don’t kno…

---

## [How can I make a very simple FSK(Frequency Shift Key) generator?](https://discourse.processing.org/t/how-can-i-make-a-very-simple-fsk-frequency-shift-key-generator/3443)

<div class="topic-metadata">

**Author:** [@8bit\_coder](https://discourse.processing.org/u/8bit_coder)\
**Replies:** 4\
**Last updated:** [September 12, 2018, 4:10am UTC](https://discourse.processing.org/t/how-can-i-make-a-very-simple-fsk-frequency-shift-key-generator/3443 "2018-09-12T04:10:40Z")

</div>

I’m trying to make a very bare bones replica of a linux program(I use windows so I can’t use it) called minimodem. What I’m trying to replicate is the part at 18 seconds, the transmitting part: youtube.com/watch?v=pwuyM…

---

## [Trying to change position of svg Shape to centre on sketch](https://discourse.processing.org/t/trying-to-change-position-of-svg-shape-to-centre-on-sketch/3080)

<div class="topic-metadata">

**Author:** [@12345](https://discourse.processing.org/u/12345)\
**Replies:** 2\
**Last updated:** [September 11, 2018, 4:52pm UTC](https://discourse.processing.org/t/trying-to-change-position-of-svg-shape-to-centre-on-sketch/3080 "2018-09-11T16:52:23Z")

</div>

Hi, I was wondering if anyone knew how to do this? I’ve changed my screen sketch size to 1968, 1080, however I can’t figure out how to position my shape in the centre of the screen? Sorry if this doesn’t make much sense. …

---

## [Missing left curly bracket](https://discourse.processing.org/t/missing-left-curly-bracket/3439)

<div class="topic-metadata">

**Author:** [@Blue\_Obsidian](https://discourse.processing.org/u/Blue_Obsidian)\
**Replies:** 4\
**Last updated:** [September 11, 2018, 10:25am UTC](https://discourse.processing.org/t/missing-left-curly-bracket/3439 "2018-09-11T10:25:24Z")

</div>

class Player { float playerY = 0; float playerX; char keyUp; char keyDown; Player(char keyU, char keyD, float pX) { keyUp = keyU; keyDown = keyD; playerX = pX; } void drawPlayer () { fill(25…

---

## [Ghost Lines Appearing After some iterations](https://discourse.processing.org/t/ghost-lines-appearing-after-some-iterations/3450)

<div class="topic-metadata">

**Author:** [@mikeyj777](https://discourse.processing.org/u/mikeyj777)\
**Replies:** 2\
**Last updated:** [September 11, 2018, 5:19am UTC](https://discourse.processing.org/t/ghost-lines-appearing-after-some-iterations/3450 "2018-09-11T05:19:14Z")

</div>

I’m new to Processing, and am trying a short script to become familiar with it. The script draws and bisects right triangles. It works ok, but after the 5th iteration, it starts to print an extra line, and I can’t seem…

---

## [Using TwelveMonkeys PSD plugin with Processing.org](https://discourse.processing.org/t/using-twelvemonkeys-psd-plugin-with-processing-org/2983)

<div class="topic-metadata">

**Author:** [@sulin](https://discourse.processing.org/u/sulin)\
**Replies:** 1\
**Last updated:** [September 10, 2018, 11:46pm UTC](https://discourse.processing.org/t/using-twelvemonkeys-psd-plugin-with-processing-org/2983 "2018-09-10T23:46:20Z")

</div>

Hi, I have just begun trying to use twelvemonkeys java ImageIO plugins with processing. ( link to git repo - https://github.com/haraldk/TwelveMonkeys) with processing-core in java. While I am able to get a psd in I want…

---

## [Robot Delta - processing](https://discourse.processing.org/t/robot-delta-processing/2987)

<div class="topic-metadata">

**Author:** [@henryk167](https://discourse.processing.org/u/henryk167)\
**Replies:** 3\
**Last updated:** [September 10, 2018, 7:08pm UTC](https://discourse.processing.org/t/robot-delta-processing/2987 "2018-09-10T19:08:27Z")

</div>

Hello. I am looking for a person who would write soft for me to control the deltabot (manually and auto). Processing should work with arduino. I will be grateful for help. Henryk

---

## [Swap Function Won't Accept Correct Parameters](https://discourse.processing.org/t/swap-function-wont-accept-correct-parameters/3435)

<div class="topic-metadata">

**Author:** [@OrangeC7](https://discourse.processing.org/u/OrangeC7)\
**Replies:** 2\
**Last updated:** [September 10, 2018, 4:16pm UTC](https://discourse.processing.org/t/swap-function-wont-accept-correct-parameters/3435 "2018-09-10T16:16:58Z")

</div>

I’m trying to use a simple swap function, but for some reason it won’t accept the array of custom objects as a parameter even though that’s what I specified when making the function. I made sure the array I put in is the…

---

## [Question about noise point reduction](https://discourse.processing.org/t/question-about-noise-point-reduction/3306)

<div class="topic-metadata">

**Author:** [@baoter](https://discourse.processing.org/u/baoter)\
**Replies:** 14\
**Last updated:** [September 10, 2018, 7:28am UTC](https://discourse.processing.org/t/question-about-noise-point-reduction/3306 "2018-09-10T07:28:28Z")

</div>

Hi, I’m working on a project with Kinect V2 and have some questions… I take the video from the depth camera of Kinect V2 and there are so many noise points!! I only need black and white color image. The idea is make the…

---

## [Loop to move rectangle down](https://discourse.processing.org/t/loop-to-move-rectangle-down/3404)

<div class="topic-metadata">

**Author:** [@Processingn00b](https://discourse.processing.org/u/Processingn00b)\
**Replies:** 3\
**Last updated:** [September 10, 2018, 5:58am UTC](https://discourse.processing.org/t/loop-to-move-rectangle-down/3404 "2018-09-10T05:58:24Z")

</div>

hello i want the rectangles that are moving down to be in a loop moving downwards and i don’t know how to do that, so when it goes off screen it starts at the top and moves downwards and repeats that cycle over and over…

---

## [Can't handle the loop](https://discourse.processing.org/t/cant-handle-the-loop/3375)

<div class="topic-metadata">

**Author:** [@losferatos](https://discourse.processing.org/u/losferatos)\
**Replies:** 8\
**Last updated:** [September 10, 2018, 3:43am UTC](https://discourse.processing.org/t/cant-handle-the-loop/3375 "2018-09-10T03:43:52Z")

</div>

Hi guys! This is a pretty basic problem: I don’t fully understand how to use loops. I want to get comfortable with using arrays and other elementary stuff so I came up with the idea of creating some kind of licence plat…

---

## [Make a few rectangles fall](https://discourse.processing.org/t/make-a-few-rectangles-fall/3360)

<div class="topic-metadata">

**Author:** [@Processingn00b](https://discourse.processing.org/u/Processingn00b)\
**Replies:** 7\
**Last updated:** [September 10, 2018, 3:18am UTC](https://discourse.processing.org/t/make-a-few-rectangles-fall/3360 "2018-09-10T03:18:44Z")

</div>

Err hello, i have no idea if this is the right website be i need to figure out how of make a few rectangles fall from the bottom of the screen in a consistent loop but they fall at different or random locations every ti…

---

## [Multiple constructors in a class](https://discourse.processing.org/t/multiple-constructors-in-a-class/3356)

<div class="topic-metadata">

**Author:** [@ddownn](https://discourse.processing.org/u/ddownn)\
**Replies:** 8\
**Last updated:** [September 10, 2018, 2:20am UTC](https://discourse.processing.org/t/multiple-constructors-in-a-class/3356 "2018-09-10T02:20:00Z")

</div>

I am trying to write a class that needs multiple constructors, and I would like some advice about whether one constructor can build off of another one. I’m really just looking for help understanding what’s possible when…

---

## [How to read selected field in scrollableList?](https://discourse.processing.org/t/how-to-read-selected-field-in-scrollablelist/3390)

<div class="topic-metadata">

**Author:** [@iamthehype](https://discourse.processing.org/u/iamthehype)\
**Replies:** 3\
**Last updated:** [September 9, 2018, 3:46pm UTC](https://discourse.processing.org/t/how-to-read-selected-field-in-scrollablelist/3390 "2018-09-09T15:46:39Z")

</div>

Disclaimer: I have no prior Java experience and very little coding experience in general. I’m trying to write a simple GUI that takes user input from a dropdown and depending on that performs simple data analysis on sen…

---

## [Random Square on a grid](https://discourse.processing.org/t/random-square-on-a-grid/3382)

<div class="topic-metadata">

**Author:** [@KeremTurkyilmaz](https://discourse.processing.org/u/KeremTurkyilmaz)\
**Replies:** 4\
**Last updated:** [September 9, 2018, 9:02am UTC](https://discourse.processing.org/t/random-square-on-a-grid/3382 "2018-09-09T09:02:28Z")

</div>

Hi, I’m trying to create a random grid, the cella size define the grid size. I want to add a random movement, when the grid is 50 I want to move the rect one time on X and Y, but randomly (like a random walker). Is th…

---

## [Trying to debug and verify port of c/c++ code](https://discourse.processing.org/t/trying-to-debug-and-verify-port-of-c-c-code/2941)

<div class="topic-metadata">

**Author:** [@HackinHarry](https://discourse.processing.org/u/HackinHarry)\
**Replies:** 12\
**Last updated:** [September 8, 2018, 10:31pm UTC](https://discourse.processing.org/t/trying-to-debug-and-verify-port-of-c-c-code/2941 "2018-09-08T22:31:46Z")

</div>

I’m working on some basic celestial navigation concepts, using Processing and Android. This particular problem is in Processing and is an attempt to port c/c++ code to Processing/Java. I started with reading a paper fr…

---

## [Quick Question About Tables](https://discourse.processing.org/t/quick-question-about-tables/3316)

<div class="topic-metadata">

**Author:** [@dtools22](https://discourse.processing.org/u/dtools22)\
**Replies:** 2\
**Last updated:** [September 7, 2018, 7:11pm UTC](https://discourse.processing.org/t/quick-question-about-tables/3316 "2018-09-07T19:11:53Z")

</div>

Hello All, I have a quick question about how to create new tables. I am working on a data analysis program for poker hands. Each time I do analysis according to certain parameters, I would like the program to create a…

---

## [Trails on a webcam image that detects motion](https://discourse.processing.org/t/trails-on-a-webcam-image-that-detects-motion/3313)

<div class="topic-metadata">

**Author:** [@unknownplayer](https://discourse.processing.org/u/unknownplayer)\
**Replies:** 2\
**Last updated:** [September 7, 2018, 6:40pm UTC](https://discourse.processing.org/t/trails-on-a-webcam-image-that-detects-motion/3313 "2018-09-07T18:40:20Z")

</div>

Hello, sorry for the vague title, couldn’t know how to describe it in a sentence. Here is the problem I’m facing; I have this piece of code which detects any kind of motion and paints those pixels to white: float dg; …

---

## [How to make keyPressed work inside a while loop](https://discourse.processing.org/t/how-to-make-keypressed-work-inside-a-while-loop/3257)

<div class="topic-metadata">

**Author:** [@Yamin](https://discourse.processing.org/u/Yamin)\
**Replies:** 7\
**Last updated:** [September 7, 2018, 4:54pm UTC](https://discourse.processing.org/t/how-to-make-keypressed-work-inside-a-while-loop/3257 "2018-09-07T16:54:20Z")

</div>

Hi guys,I’m working on a project and I need to detect keypressed inside a while loop. Basically there is going to be couple of while loops and depending on the key pressed, the program will come out from the while loop. …

---

## [Trying to Draw a ball for a Pong Game](https://discourse.processing.org/t/trying-to-draw-a-ball-for-a-pong-game/3073)

<div class="topic-metadata">

**Author:** [@Blue\_Obsidian](https://discourse.processing.org/u/Blue_Obsidian)\
**Replies:** 13\
**Last updated:** [September 7, 2018, 2:19pm UTC](https://discourse.processing.org/t/trying-to-draw-a-ball-for-a-pong-game/3073 "2018-09-07T14:19:45Z")

</div>

float ballX = 200; float ballY = 200; float playerY = 0; boolean accX = true; boolean accY = true; boolean first = true; boolean game\_over = false; void setup (){ size(500, 500); background (0); fill(255); re…

---

## [\[99% SOLVED\]Klein Bottle rendering?](https://discourse.processing.org/t/99-solved-klein-bottle-rendering/2262)

<div class="topic-metadata">

**Author:** [@kll](https://discourse.processing.org/u/kll)\
**Replies:** 5\
**Last updated:** [September 7, 2018, 9:00am UTC](https://discourse.processing.org/t/99-solved-klein-bottle-rendering/2262 "2018-09-07T09:00:08Z")

</div>

i wanted to test the math i found at internet and draw a KLEIN BOTTLE and i try to render it by KleinS.beginShape(TRIANGLE\_STRIP); KleinS.vertex(xs, ys, zs); KleinS.vertex(xs+1, ys+1, zs+1); and i got something wha…

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

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