# Coding Questions

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

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

**Page:** 178

---

## [Quick Question on line graphs](https://discourse.processing.org/t/quick-question-on-line-graphs/2786)

<div class="topic-metadata">

**Author:** [@Groot](https://discourse.processing.org/u/Groot)\
**Replies:** 4\
**Last updated:** [August 22, 2018, 6:20am UTC](https://discourse.processing.org/t/quick-question-on-line-graphs/2786 "2018-08-22T06:20:41Z")

</div>

From a previous i found the below (thanks again to TFguy44: how would you have multiple of these lines running at the same time on the same page? Thanks. int x = 0; float py = 0; void setup(){ size(600,200); bac…

---

## [Change the array items color one by one](https://discourse.processing.org/t/change-the-array-items-color-one-by-one/2832)

<div class="topic-metadata">

**Author:** [@tefa](https://discourse.processing.org/u/tefa)\
**Replies:** 8\
**Last updated:** [August 22, 2018, 5:50am UTC](https://discourse.processing.org/t/change-the-array-items-color-one-by-one/2832 "2018-08-22T05:50:48Z")

</div>

Hello processors! this is my first question here (two questions), I hope to get quick answers. I made an array of 4 ellipses and I want to change their color one by one to red, each time I mousePressed accordingly in or…

---

## [Shape touching shape](https://discourse.processing.org/t/shape-touching-shape/2818)

<div class="topic-metadata">

**Author:** [@FurryNightShade](https://discourse.processing.org/u/FurryNightShade)\
**Replies:** 3\
**Last updated:** [August 22, 2018, 4:45am UTC](https://discourse.processing.org/t/shape-touching-shape/2818 "2018-08-22T04:45:34Z")

</div>

Hello, as I am writing Dubtank 2, I came across a problem. I want to detect whether a tank touches another tank. I know or I can calculate the exact position of all points and detecting crossing straight line segments …

---

## [Class Method and Private Method](https://discourse.processing.org/t/class-method-and-private-method/2798)

<div class="topic-metadata">

**Author:** [@Manatee](https://discourse.processing.org/u/Manatee)\
**Replies:** 16\
**Last updated:** [August 21, 2018, 9:12pm UTC](https://discourse.processing.org/t/class-method-and-private-method/2798 "2018-08-21T21:12:57Z")

</div>

Hi everybody, Im trying to use some class method that I create but it is not work cause of the error: The method “method\_name” cannot be declared static; static methods can only be declared in a static or top level type. …

---

## [Processing 3 borders](https://discourse.processing.org/t/processing-3-borders/2823)

<div class="topic-metadata">

**Author:** [@MTech](https://discourse.processing.org/u/MTech)\
**Replies:** 3\
**Last updated:** [August 21, 2018, 8:29pm UTC](https://discourse.processing.org/t/processing-3-borders/2823 "2018-08-21T20:29:41Z")

</div>

Hello, I’ve been trying to write a fairly simple overlay-timer using processing 3. I managed to remove the bar’s around the application, but for some reason there is a grey surface which i can’t seem to get rid of. Thi…

---

## [2d movement with 3d camera work](https://discourse.processing.org/t/2d-movement-with-3d-camera-work/1967)

<div class="topic-metadata">

**Author:** [@relix](https://discourse.processing.org/u/relix)\
**Replies:** 12\
**Last updated:** [August 21, 2018, 3:10pm UTC](https://discourse.processing.org/t/2d-movement-with-3d-camera-work/1967 "2018-08-21T15:10:49Z")

</div>

first thing, here is my code: https://pastebin.com/W6cQaZWw i tried my best to include comments to describe each part of it what I’m stuck at is making the player move across the floor. The camera needs to be followin…

---

## [Writing Files over shared LAN folder](https://discourse.processing.org/t/writing-files-over-shared-lan-folder/2814)

<div class="topic-metadata">

**Author:** [@KemyKo](https://discourse.processing.org/u/KemyKo)\
**Replies:** 1\
**Last updated:** [August 21, 2018, 2:17pm UTC](https://discourse.processing.org/t/writing-files-over-shared-lan-folder/2814 "2018-08-21T14:17:54Z")

</div>

The title says everything. I want to create and read files from my phone to my pc. I created a folder in Documents/TestFolder Right Click -\> Properties -\> Share -\> Everyone(Read+Write). I am left with this: //192.168.…

---

## [Should functions go before or after setup() and draw()?](https://discourse.processing.org/t/should-functions-go-before-or-after-setup-and-draw/2793)

<div class="topic-metadata">

**Author:** [@TheWizardBear](https://discourse.processing.org/u/TheWizardBear)\
**Replies:** 7\
**Last updated:** [August 21, 2018, 7:25am UTC](https://discourse.processing.org/t/should-functions-go-before-or-after-setup-and-draw/2793 "2018-08-21T07:25:10Z")

</div>

I know that it doesn’t make any difference as to how the program is run, but is it good practice to put functions you have declared before or after setup() and draw(), or is it just personal preference? Does it make a…

---

## [Losing points when zooming?!](https://discourse.processing.org/t/losing-points-when-zooming/2806)

<div class="topic-metadata">

**Author:** [@aarontownsend](https://discourse.processing.org/u/aarontownsend)\
**Replies:** 2\
**Last updated:** [August 21, 2018, 2:24am UTC](https://discourse.processing.org/t/losing-points-when-zooming/2806 "2018-08-21T02:24:18Z")

</div>

Hi - new here be gentle! So I’ve just started out on Processing. I have ~10000 GPS positions (airports etc) which I wanted to covert to points and display it in a 3D Vector. All works well. However, when I Zoom in and…

---

## [Question about add Bias after moltiplication](https://discourse.processing.org/t/question-about-add-bias-after-moltiplication/2808)

<div class="topic-metadata">

**Author:** [@Manatee](https://discourse.processing.org/u/Manatee)\
**Replies:** 1\
**Last updated:** [August 20, 2018, 11:08pm UTC](https://discourse.processing.org/t/question-about-add-bias-after-moltiplication/2808 "2018-08-20T23:08:15Z")

</div>

I saw this (https://www.youtube.com/watch?v=MPmLWsHzPlU) video where the teacher explain how to build a god network after trying by myself Im stuck with this problem. He said to add the bias after moltiplication between…

---

## [3d shape with different texture (easy way)?](https://discourse.processing.org/t/3d-shape-with-different-texture-easy-way/2764)

<div class="topic-metadata">

**Author:** [@Laurent](https://discourse.processing.org/u/Laurent)\
**Replies:** 3\
**Last updated:** [August 20, 2018, 12:28am UTC](https://discourse.processing.org/t/3d-shape-with-different-texture-easy-way/2764 "2018-08-20T00:28:43Z")

</div>

Hi everyone! Certainly a basic question but… is it possibe to add different textures to a 3d basic shape (for instance a cube)? Using p5.js (and not webgl ou three.js). And if possible without creating a set of different…

---

## [Make rotated images horizontaly oriented and canvas responsiveness](https://discourse.processing.org/t/make-rotated-images-horizontaly-oriented-and-canvas-responsiveness/2781)

<div class="topic-metadata">

**Author:** [@leo](https://discourse.processing.org/u/leo)\
**Replies:** 2\
**Last updated:** [August 19, 2018, 11:49pm UTC](https://discourse.processing.org/t/make-rotated-images-horizontaly-oriented-and-canvas-responsiveness/2781 "2018-08-19T23:49:21Z")

</div>

Can someone help me with this code pen? I am trying to find a way to keep the images oriented horizontaly and not this radial situation. Also i am having issues making the elements inside this canvas responsive to fit …

---

## [How to access each item from the loop via return function](https://discourse.processing.org/t/how-to-access-each-item-from-the-loop-via-return-function/2765)

<div class="topic-metadata">

**Author:** [@Olygamy](https://discourse.processing.org/u/Olygamy)\
**Replies:** 3\
**Last updated:** [August 19, 2018, 7:46pm UTC](https://discourse.processing.org/t/how-to-access-each-item-from-the-loop-via-return-function/2765 "2018-08-19T19:46:31Z")

</div>

Hello there, Another return function question. I have a for loop of distances between a set of xai and xbi positions in the class. I need to be able to access each distance individually. I wrote the function below which…

---

## [Game of life issue](https://discourse.processing.org/t/game-of-life-issue/2777)

<div class="topic-metadata">

**Author:** [@bertin](https://discourse.processing.org/u/bertin)\
**Replies:** 5\
**Last updated:** [August 19, 2018, 7:28pm UTC](https://discourse.processing.org/t/game-of-life-issue/2777 "2018-08-19T19:28:06Z")

</div>

Hi everyone! I was trying to implement the Game of Life using Processing but my code is not working as it’s supposed to be. I’ve already looked up on the internet and it seems to me that my implementation looks very clos…

---

## [Can't get hex bytes from file](https://discourse.processing.org/t/cant-get-hex-bytes-from-file/2752)

<div class="topic-metadata">

**Author:** [@Odermonicon](https://discourse.processing.org/u/Odermonicon)\
**Replies:** 2\
**Last updated:** [August 19, 2018, 2:54pm UTC](https://discourse.processing.org/t/cant-get-hex-bytes-from-file/2752 "2018-08-19T14:54:04Z")

</div>

I am trying to make a 6502 disassembler and found out that saveBytes() and loadBytes() do not save and load hex bytes, I tried to extract a text file containing the letter “a” expecting to get “61” but got “\[B@1c0f834d”,…

---

## [Upload random Shape](https://discourse.processing.org/t/upload-random-shape/2751)

<div class="topic-metadata">

**Author:** [@vale](https://discourse.processing.org/u/vale)\
**Replies:** 2\
**Last updated:** [August 19, 2018, 9:18am UTC](https://discourse.processing.org/t/upload-random-shape/2751 "2018-08-19T09:18:22Z")

</div>

Hi everyone, I am trying to upload randomly svg files with this method: The pictures are picked to form 3 different groups it should be displayed 3 images at time. \[i did an example to be sure\] That’s what I have d…

---

## [Detect if sound is playing something in another application](https://discourse.processing.org/t/detect-if-sound-is-playing-something-in-another-application/2696)

<div class="topic-metadata">

**Author:** [@Birb](https://discourse.processing.org/u/Birb)\
**Replies:** 2\
**Last updated:** [August 17, 2018, 9:23am UTC](https://discourse.processing.org/t/detect-if-sound-is-playing-something-in-another-application/2696 "2018-08-17T09:23:34Z")

</div>

I want to detect when sound is being played on the computer a processing sketch is running on. Example: Audio playback starts in browser, processing sketch executes action - for example a keyboard shortcut to pause a l…

---

## [Rotating array of circles around a circle](https://discourse.processing.org/t/rotating-array-of-circles-around-a-circle/2676)

<div class="topic-metadata">

**Author:** [@leo](https://discourse.processing.org/u/leo)\
**Replies:** 8\
**Last updated:** [August 17, 2018, 9:28pm UTC](https://discourse.processing.org/t/rotating-array-of-circles-around-a-circle/2676 "2018-08-17T21:28:27Z")

</div>

var canvas; var width = window.innerWidth; var height = window.innerHeight; var circles = \[\]; var lines = \[\]; var xoff = 0; var angle = 0; class Circles{ constructor(x, y, rad, color){ this.x = x; this.y = y; t…

---

## [Need help scrambling an image](https://discourse.processing.org/t/need-help-scrambling-an-image/2667)

<div class="topic-metadata">

**Author:** [@yxzageo](https://discourse.processing.org/u/yxzageo)\
**Replies:** 8\
**Last updated:** [August 17, 2018, 7:22pm UTC](https://discourse.processing.org/t/need-help-scrambling-an-image/2667 "2018-08-17T19:22:09Z")

</div>

Hello, I posed a question about a code snippet a few days ago and got a quick and understandable answer. I have this piece of code that I’m trying to figure out what it does and how to reverse the action. Unfortunately I…

---

## [\[SOLVED\] I'm failing at drawing multiple quads in a loop](https://discourse.processing.org/t/solved-im-failing-at-drawing-multiple-quads-in-a-loop/2700)

<div class="topic-metadata">

**Author:** [@delsey](https://discourse.processing.org/u/delsey)\
**Replies:** 7\
**Last updated:** [August 17, 2018, 3:53pm UTC](https://discourse.processing.org/t/solved-im-failing-at-drawing-multiple-quads-in-a-loop/2700 "2018-08-17T15:53:15Z")

</div>

I am trying to draw multiple quads in a for-loop. It looks like this: for(int i = 0; i \< o.getAllObjects().length; i++) { float\[\] objects = o.getAllObjects(); println(objects\[i\]); fill(255); noStroke(); quad(o…

---

## [Importing Depth Map data (XEF)?](https://discourse.processing.org/t/importing-depth-map-data-xef/2619)

<div class="topic-metadata">

**Author:** [@rcargb](https://discourse.processing.org/u/rcargb)\
**Replies:** 2\
**Last updated:** [August 17, 2018, 2:34pm UTC](https://discourse.processing.org/t/importing-depth-map-data-xef/2619 "2018-08-17T14:34:24Z")

</div>

Is there a way to import Depth Map data and/or XEF files into processing for use in a point cloud? I’ve seen a few topics on exporting, next to nothing on importing. I’ve not got a working Kinect atm and plan on using …

---

## [Multiple images to video](https://discourse.processing.org/t/multiple-images-to-video/2703)

<div class="topic-metadata">

**Author:** [@barekatf](https://discourse.processing.org/u/barekatf)\
**Replies:** 6\
**Last updated:** [August 16, 2018, 10:46pm UTC](https://discourse.processing.org/t/multiple-images-to-video/2703 "2018-08-16T22:46:33Z")

</div>

Hi I have 140 folders, each having 35 pictures. All the images have the exact same resolution. I would like to make a video of all pictures in a way that each picture is shown for only 1/30th of a second. I need help …

---

## [Saving data and timestamps to csv (noob)](https://discourse.processing.org/t/saving-data-and-timestamps-to-csv-noob/2674)

<div class="topic-metadata">

**Author:** [@ripple18](https://discourse.processing.org/u/ripple18)\
**Replies:** 3\
**Last updated:** [August 16, 2018, 6:56pm UTC](https://discourse.processing.org/t/saving-data-and-timestamps-to-csv-noob/2674 "2018-08-16T18:56:42Z")

</div>

Hello! I’m trying to save data from my Arduino to a csv file using Processing. I’ve successfully saved the raw data (one number at a time) to a txt file, but my goal is to save both that data and timestamps to a csv. I …

---

## [textSize causing OutOfMemoryError](https://discourse.processing.org/t/textsize-causing-outofmemoryerror/2678)

<div class="topic-metadata">

**Author:** [@geek96boolean10](https://discourse.processing.org/u/geek96boolean10)\
**Replies:** 2\
**Last updated:** [August 16, 2018, 4:39pm UTC](https://discourse.processing.org/t/textsize-causing-outofmemoryerror/2678 "2018-08-16T16:39:03Z")

</div>

I have a program that requires textSize to increase over time. When running it gradually, i.e. textSize(4),5,6,7,etc., the number can reach a very high value without anything bad happening. However, if I try to start off…

---

## [Movement of shapes in an orbit](https://discourse.processing.org/t/movement-of-shapes-in-an-orbit/2688)

<div class="topic-metadata">

**Author:** [@Kirrat](https://discourse.processing.org/u/Kirrat)\
**Replies:** 4\
**Last updated:** [August 16, 2018, 10:47am UTC](https://discourse.processing.org/t/movement-of-shapes-in-an-orbit/2688 "2018-08-16T10:47:32Z")

</div>

Hi I’m trying to make a shape appear and start moving in an orbit whenever any of the shape above is clicked. So far i’m able to make shapes appear but i want a single shape to appear on a single click but as you can se…

---

## [Load sounds with an array of SoundFile](https://discourse.processing.org/t/load-sounds-with-an-array-of-soundfile/2659)

<div class="topic-metadata">

**Author:** [@math](https://discourse.processing.org/u/math)\
**Replies:** 2\
**Last updated:** [August 16, 2018, 9:18am UTC](https://discourse.processing.org/t/load-sounds-with-an-array-of-soundfile/2659 "2018-08-16T09:18:52Z")

</div>

I try to load multiple sounds with an array of SoundFile, but I keep getting a Error: Soundfile doesn't exist. Pleae check path when I try to initalize the array. Here’s my function (I want it to return a SoundFile arra…

---

## [How to add stroke/fill/colour options to svg shape](https://discourse.processing.org/t/how-to-add-stroke-fill-colour-options-to-svg-shape/2666)

<div class="topic-metadata">

**Author:** [@12345](https://discourse.processing.org/u/12345)\
**Replies:** 3\
**Last updated:** [August 16, 2018, 4:57am UTC](https://discourse.processing.org/t/how-to-add-stroke-fill-colour-options-to-svg-shape/2666 "2018-08-16T04:57:30Z")

</div>

Hi, I’m new to this and currently trying to figure out how to add stroke fill and colour options to my shape? this is my code so far

---

## [How to get the position of moving pixel with camera](https://discourse.processing.org/t/how-to-get-the-position-of-moving-pixel-with-camera/2494)

<div class="topic-metadata">

**Author:** [@l-q-s](https://discourse.processing.org/u/l-q-s)\
**Replies:** 9\
**Last updated:** [August 15, 2018, 9:09pm UTC](https://discourse.processing.org/t/how-to-get-the-position-of-moving-pixel-with-camera/2494 "2018-08-15T21:09:12Z")

</div>

I tried to convert the code on this url into the code that processing could run. MotionDetectionTest In order to capture the position of multiple moving pixels with the camera, I completed the conversion of some of the…

---

## [Alternative to using get() in a big PGraphics](https://discourse.processing.org/t/alternative-to-using-get-in-a-big-pgraphics/2654)

<div class="topic-metadata">

**Author:** [@Extension\_Shoe](https://discourse.processing.org/u/Extension_Shoe)\
**Replies:** 5\
**Last updated:** [August 15, 2018, 8:49am UTC](https://discourse.processing.org/t/alternative-to-using-get-in-a-big-pgraphics/2654 "2018-08-15T08:49:39Z")

</div>

Hey so I am trying to write a simple space fighting game that can be played on LAN I am using PGraphics to generate a map that has a size of 10000x10000 (I know a bit overkill but I also tried 5000x5000 and increasing di…

---

## [Using custom \`main(String\[\] args)\` breaks file reading functions in Windows (e.g. \`loadShader()\`, \`loadImage()\`)](https://discourse.processing.org/t/using-custom-main-string-args-breaks-file-reading-functions-in-windows-e-g-loadshader-loadimage/2572)

<div class="topic-metadata">

**Author:** [@haschdl](https://discourse.processing.org/u/haschdl)\
**Replies:** 14\
**Last updated:** [August 14, 2018, 7:47pm UTC](https://discourse.processing.org/t/using-custom-main-string-args-breaks-file-reading-functions-in-windows-e-g-loadshader-loadimage/2572 "2018-08-14T19:47:33Z")

</div>

Hello, I’m using loadShader() and loading a file which is saved to the data folder. I changed my sketch to include a custom main() function, however the loadShader function doesn’t work after that (Processing 3.3.7, Wi…

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

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