# Coding Questions

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

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

**Page:** 54

---

## [How to access photos if importing Processing into eclipse?](https://discourse.processing.org/t/how-to-access-photos-if-importing-processing-into-eclipse/29995)

<div class="topic-metadata">

**Author:** [@Magic](https://discourse.processing.org/u/Magic)\
**Replies:** 3\
**Last updated:** [May 10, 2021, 11:59pm UTC](https://discourse.processing.org/t/how-to-access-photos-if-importing-processing-into-eclipse/29995 "2021-05-10T23:59:09Z")

</div>

Hello, I am currently working on a photomosaic project. It’s the same one that The Coding Train did a video on. I just tried to port it into eclipse, and am adding some extra functions. How does one make it to where ecli…

---

## [How do i make an object bounce off another](https://discourse.processing.org/t/how-do-i-make-an-object-bounce-off-another/29999)

<div class="topic-metadata">

**Author:** [@cloofs](https://discourse.processing.org/u/cloofs)\
**Replies:** 1\
**Last updated:** [May 10, 2021, 4:19am UTC](https://discourse.processing.org/t/how-do-i-make-an-object-bounce-off-another/29999 "2021-05-10T04:19:43Z")

</div>

I’m doing a code where i want a ball(pong) to bounce off a rectangle(bouncer). does anyone know the code for a bounce off?

---

## [Display PImage array elements in specific locations](https://discourse.processing.org/t/display-pimage-array-elements-in-specific-locations/29979)

<div class="topic-metadata">

**Author:** [@12345](https://discourse.processing.org/u/12345)\
**Replies:** 2\
**Last updated:** [May 9, 2021, 10:20am UTC](https://discourse.processing.org/t/display-pimage-array-elements-in-specific-locations/29979 "2021-05-09T10:20:36Z")

</div>

Hi! I’ve written a sketch that loads one PImage then slices this image into 16 equal (200px x 200px) “slices”. I have then created an array of PImage “slices” with 16 slots. I have written a for loop to look through the …

---

## [Save mouse coordinates and draw arrows with it](https://discourse.processing.org/t/save-mouse-coordinates-and-draw-arrows-with-it/29982)

<div class="topic-metadata">

**Author:** [@elenanito](https://discourse.processing.org/u/elenanito)\
**Replies:** 2\
**Last updated:** [May 9, 2021, 12:26pm UTC](https://discourse.processing.org/t/save-mouse-coordinates-and-draw-arrows-with-it/29982 "2021-05-09T12:26:06Z")

</div>

Im working on a program that draws arrows with the mouse, so for the tip of the arrow to be pointing in the right direction Im using PVector (one for the base and one for the tip of the arrow). I made it work so you can …

---

## [Making random only appear once](https://discourse.processing.org/t/making-random-only-appear-once/29783)

<div class="topic-metadata">

**Author:** [@yagirl\_belle](https://discourse.processing.org/u/yagirl_belle)\
**Replies:** 5\
**Last updated:** [May 9, 2021, 1:47am UTC](https://discourse.processing.org/t/making-random-only-appear-once/29783 "2021-05-09T01:47:20Z")

</div>

PLEASE DO NOT RUN THIS CODE IF YOU HAVE EPILEPSY So I was able to create randomly generated green colours for a golf course, however it is consistently running and I don’t know what kind of ‘if’ statement I should be pu…

---

## [Why does drawing an image for the first time slow down the sketch](https://discourse.processing.org/t/why-does-drawing-an-image-for-the-first-time-slow-down-the-sketch/29909)

<div class="topic-metadata">

**Author:** [@s31](https://discourse.processing.org/u/s31)\
**Replies:** 10\
**Last updated:** [May 8, 2021, 1:38pm UTC](https://discourse.processing.org/t/why-does-drawing-an-image-for-the-first-time-slow-down-the-sketch/29909 "2021-05-08T13:38:35Z")

</div>

Every time my code uses a new image, my sketch slows down considerably and I don’t understand why. I’m loading all of my images in the setup() function like everyone says I should, so I don’t understand why this is happe…

---

## [Reflect color of one object to another object through cursor position](https://discourse.processing.org/t/reflect-color-of-one-object-to-another-object-through-cursor-position/29888)

<div class="topic-metadata">

**Author:** [@joelm03](https://discourse.processing.org/u/joelm03)\
**Replies:** 13\
**Last updated:** [May 7, 2021, 2:49pm UTC](https://discourse.processing.org/t/reflect-color-of-one-object-to-another-object-through-cursor-position/29888 "2021-05-07T14:49:27Z")

</div>

I am trying to have a gradient RGB rectangle to reflect each color on a bigger rectangle depending on the mouse’s position. I was able to come up with this: void draw() { noStroke(); for (i = 0;i \< width; i++) { fil…

---

## [Question: Running multiple draw loops simultaneously in a grid](https://discourse.processing.org/t/question-running-multiple-draw-loops-simultaneously-in-a-grid/29927)

<div class="topic-metadata">

**Author:** [@markcburke](https://discourse.processing.org/u/markcburke)\
**Replies:** 5\
**Last updated:** [May 7, 2021, 1:29pm UTC](https://discourse.processing.org/t/question-running-multiple-draw-loops-simultaneously-in-a-grid/29927 "2021-05-07T13:29:54Z")

</div>

I’m quite new to processing and am interested in using it to generate grids of semi-randomized objects of various kinds. I’ve managed to produce code that can generate the kind of objects that I want, but I don’t know ho…

---

## [Get all children from SVG](https://discourse.processing.org/t/get-all-children-from-svg/29932)

<div class="topic-metadata">

**Author:** [@thesandrobrito](https://discourse.processing.org/u/thesandrobrito)\
**Replies:** 8\
**Last updated:** [May 7, 2021, 11:36am UTC](https://discourse.processing.org/t/get-all-children-from-svg/29932 "2021-05-07T11:36:32Z")

</div>

Hi Everyone. I came back to processing after a few years of not coding anything and I am struggling with something I think I could do before. I’m looking to draw SVGs with the flexibility of changing the colours of the…

---

## [Reading barcodes](https://discourse.processing.org/t/reading-barcodes/29868)

<div class="topic-metadata">

**Author:** [@Th3cG](https://discourse.processing.org/u/Th3cG)\
**Replies:** 28\
**Last updated:** [May 7, 2021, 6:44am UTC](https://discourse.processing.org/t/reading-barcodes/29868 "2021-05-07T06:44:28Z")

</div>

Ciao! I’d like to scan some UPC barcodes to get the product number, and after some research I unsuccessfully used the following libraries Zxing for Processing (unable to load some plugins for gstreamer 1.0) and QRCode…

---

## [Issue in ellipse collision](https://discourse.processing.org/t/issue-in-ellipse-collision/29923)

<div class="topic-metadata">

**Author:** [@helloscoopz](https://discourse.processing.org/u/helloscoopz)\
**Replies:** 6\
**Last updated:** [May 6, 2021, 9:28pm UTC](https://discourse.processing.org/t/issue-in-ellipse-collision/29923 "2021-05-06T21:28:32Z")

</div>

CowDemo.pde ArrayList\<Cow\> particles; void setup() { frameRate(30); //size(1000, 800); size(300, 300); particles = new ArrayList\<Cow\>(); for (int i = 0; i \<= 1; i++) { particles.add(new Cow()); } } voi…

---

## [Multiple Windows, closing and interactions](https://discourse.processing.org/t/multiple-windows-closing-and-interactions/25693)

<div class="topic-metadata">

**Author:** [@MiguelSanches](https://discourse.processing.org/u/MiguelSanches)\
**Replies:** 1\
**Last updated:** [May 6, 2021, 1:25pm UTC](https://discourse.processing.org/t/multiple-windows-closing-and-interactions/25693 "2021-05-06T13:25:12Z")

</div>

Hi, For the last days, I have been playing with PApplet’s and creating multiple windows. After some long research I found this post on the forum (https://discourse.processing.org/t/closing-a-second-window/381/10) Now,…

---

## [Draw a circle segment](https://discourse.processing.org/t/draw-a-circle-segment/29900)

<div class="topic-metadata">

**Author:** [@SaftigMelo](https://discourse.processing.org/u/SaftigMelo)\
**Replies:** 4\
**Last updated:** [May 6, 2021, 9:55am UTC](https://discourse.processing.org/t/draw-a-circle-segment/29900 "2021-05-06T09:55:43Z")

</div>

Hello, I am currently trying to draw a sailboat with Processing in Java. I'm failing on the bottom part right now. I was thinking that I can use a circle segment for it. I wanted to use the arc() method for this only…

---

## [Map texture onto PATH shape](https://discourse.processing.org/t/map-texture-onto-path-shape/29891)

<div class="topic-metadata">

**Author:** [@Frinkel](https://discourse.processing.org/u/Frinkel)\
**Replies:** 1\
**Last updated:** [May 5, 2021, 4:17pm UTC](https://discourse.processing.org/t/map-texture-onto-path-shape/29891 "2021-05-05T16:17:58Z")

</div>

Hello, I have a shape, which has a texture applied to it, but I would like the shape to be of type PATH, since this will allow the use of the contains(x,y) method. The problem is, if I change the shape type to PATH, no …

---

## [Map image onto shape](https://discourse.processing.org/t/map-image-onto-shape/29879)

<div class="topic-metadata">

**Author:** [@Frinkel](https://discourse.processing.org/u/Frinkel)\
**Replies:** 2\
**Last updated:** [May 5, 2021, 1:15pm UTC](https://discourse.processing.org/t/map-image-onto-shape/29879 "2021-05-05T13:15:46Z")

</div>

Hi I’m working with the processing library for Java, and are having some issues giving my shapes a texture, right now, the texture isn’t showing. I hope some of you guys might have an idea, of what I’m doing wrong. IDE …

---

## [Bars:Beats:Sixteenths](https://discourse.processing.org/t/barssixteenths/29821)

<div class="topic-metadata">

**Author:** [@UnderratedGuitarGUY](https://discourse.processing.org/u/UnderratedGuitarGUY)\
**Replies:** 4\
**Last updated:** [May 4, 2021, 11:16pm UTC](https://discourse.processing.org/t/barssixteenths/29821 "2021-05-04T23:16:45Z")

</div>

please format code with \</\> button \* homework policy \* asking questions Hey, I’ve been working through a javascript beginners guide recently and I was wondering whether anyone could help me out with two conversion qu…

---

## [Nodes System coding in Processing](https://discourse.processing.org/t/nodes-system-coding-in-processing/29736)

<div class="topic-metadata">

**Author:** [@PokeAvi](https://discourse.processing.org/u/PokeAvi)\
**Replies:** 5\
**Last updated:** [May 4, 2021, 11:05pm UTC](https://discourse.processing.org/t/nodes-system-coding-in-processing/29736 "2021-05-04T23:05:41Z")

</div>

Hello world! I am developing a school project that asks me to implement a node system that can be used in the production of design objects. It has to be a functional application in some field of design (product, archite…

---

## [Unexpected conditional behavior in sin() calculation](https://discourse.processing.org/t/unexpected-conditional-behavior-in-sin-calculation/29841)

<div class="topic-metadata">

**Author:** [@theta](https://discourse.processing.org/u/theta)\
**Replies:** 3\
**Last updated:** [May 4, 2021, 8:00am UTC](https://discourse.processing.org/t/unexpected-conditional-behavior-in-sin-calculation/29841 "2021-05-04T08:00:28Z")

</div>

Hey everyone! Entirely new to the forum and to Processing. I do have some casual knowledge of C# via Unity and coding in general but still very much a beginner. I’ve been playing around with an example from the Processi…

---

## [How do I move a shape along a sine curve?](https://discourse.processing.org/t/how-do-i-move-a-shape-along-a-sine-curve/29830)

<div class="topic-metadata">

**Author:** [@idonwannadothisanymo](https://discourse.processing.org/u/idonwannadothisanymo)\
**Replies:** 4\
**Last updated:** [May 3, 2021, 10:34pm UTC](https://discourse.processing.org/t/how-do-i-move-a-shape-along-a-sine-curve/29830 "2021-05-03T22:34:41Z")

</div>

I want to move a circle along a sine curve. How do I do this? Pleassseee!

---

## [HSB resolution Question](https://discourse.processing.org/t/hsb-resolution-question/29735)

<div class="topic-metadata">

**Author:** [@IRIGIMA](https://discourse.processing.org/u/IRIGIMA)\
**Replies:** 7\
**Last updated:** [May 3, 2021, 7:29pm UTC](https://discourse.processing.org/t/hsb-resolution-question/29735 "2021-05-03T19:29:31Z")

</div>

Using HSB colour mode, does anyone know the correct resolution / setting for each without any internal calculations?? Example: colorMode(HSB, 45,97,43) would cause a conversion when reading / writing values respective t…

---

## [Issue with my code](https://discourse.processing.org/t/issue-with-my-code/29822)

<div class="topic-metadata">

**Author:** [@Pokeyace](https://discourse.processing.org/u/Pokeyace)\
**Replies:** 1\
**Last updated:** [May 3, 2021, 6:39pm UTC](https://discourse.processing.org/t/issue-with-my-code/29822 "2021-05-03T18:39:43Z")

</div>

int r=25; //small circle int R=160; //big circle int d=100; //distance from small circle center float theta=0; float speed = 0.008; //determines how fast theta is increased, higher speed = faster program but lower qu…

---

## [How to use transformations to create a stripe pattern](https://discourse.processing.org/t/how-to-use-transformations-to-create-a-stripe-pattern/29629)

<div class="topic-metadata">

**Author:** [@anon1](https://discourse.processing.org/u/anon1)\
**Replies:** 6\
**Last updated:** [May 3, 2021, 4:22pm UTC](https://discourse.processing.org/t/how-to-use-transformations-to-create-a-stripe-pattern/29629 "2021-05-03T16:22:43Z")

</div>

Hello I am new to processing and one of my assigments is to create patterns within processing using push and pop matrix. I decided to try and create somthing simialr to this however i’ve been stuck on figuering out ho…

---

## [Thread function in class](https://discourse.processing.org/t/thread-function-in-class/29814)

<div class="topic-metadata">

**Author:** [@Flolo](https://discourse.processing.org/u/Flolo)\
**Replies:** 1\
**Last updated:** [May 3, 2021, 3:24pm UTC](https://discourse.processing.org/t/thread-function-in-class/29814 "2021-05-03T15:24:47Z")

</div>

Hey I want to call a public function in a public class in the same class in processing (JAVA mode). The Error: Here is the complete code: ParticleSystem ps; PImage imageShape; float deltaTime = 0; void setup() {…

---

## [Run animation from the end point to the beginning point](https://discourse.processing.org/t/run-animation-from-the-end-point-to-the-beginning-point/29798)

<div class="topic-metadata">

**Author:** [@chan](https://discourse.processing.org/u/chan)\
**Replies:** 2\
**Last updated:** [May 3, 2021, 11:06am UTC](https://discourse.processing.org/t/run-animation-from-the-end-point-to-the-beginning-point/29798 "2021-05-03T11:06:02Z")

</div>

How to make an animation composed of lines, run animation from the end point to the beginning point ? Thank you :sweat\_smile:

---

## ["breakout" type game](https://discourse.processing.org/t/breakout-type-game/29743)

<div class="topic-metadata">

**Author:** [@Lolita](https://discourse.processing.org/u/Lolita)\
**Replies:** 4\
**Last updated:** [April 30, 2021, 9:26pm UTC](https://discourse.processing.org/t/breakout-type-game/29743 "2021-04-30T21:26:28Z")

</div>

Hi i got question as a video mp4 “breakout” type game with arc any source code to work with!

---

## [How can I load the image? (mousePressed, case)](https://discourse.processing.org/t/how-can-i-load-the-image-mousepressed-case/29763)

<div class="topic-metadata">

**Author:** [@Yujung](https://discourse.processing.org/u/Yujung)\
**Replies:** 3\
**Last updated:** [May 1, 2021, 4:37pm UTC](https://discourse.processing.org/t/how-can-i-load-the-image-mousepressed-case/29763 "2021-05-01T16:37:11Z")

</div>

After the ‘start’ image appears in case2, I want case3 to appear when I press a certain part. But case3 is not loaded. What could be the problem? import processing.video.\*; Movie intro; int caseNum=1; PImage start; PIm…

---

## [Genuinely don't know where to go from here (golf game)](https://discourse.processing.org/t/genuinely-dont-know-where-to-go-from-here-golf-game/29715)

<div class="topic-metadata">

**Author:** [@yagirl\_belle](https://discourse.processing.org/u/yagirl_belle)\
**Replies:** 4\
**Last updated:** [May 2, 2021, 1:02am UTC](https://discourse.processing.org/t/genuinely-dont-know-where-to-go-from-here-golf-game/29715 "2021-05-02T01:02:34Z")

</div>

Hey y’all I’m tryna make a golf game where when you shoot the ball, the happy face turns into a surprise face and the ball launches from the mouth. I can’t figure out what the heck I’m doing wrong. boolean launch = true…

---

## [Random SkyLine lab](https://discourse.processing.org/t/random-skyline-lab/29766)

<div class="topic-metadata">

**Author:** [@Syntax64](https://discourse.processing.org/u/Syntax64)\
**Replies:** 5\
**Last updated:** [May 1, 2021, 8:59pm UTC](https://discourse.processing.org/t/random-skyline-lab/29766 "2021-05-01T20:59:46Z")

</div>

I’m Struggling to figure out a small detail in my project. How do I make windows that randomly are either yellow or black and are set in a grid according to the building? How it should look. int\[\] buildingHeights = new…

---

## [Map latitude and longitude coordinates to a an image?](https://discourse.processing.org/t/map-latitude-and-longitude-coordinates-to-a-an-image/29746)

<div class="topic-metadata">

**Author:** [@brolly301](https://discourse.processing.org/u/brolly301)\
**Replies:** 7\
**Last updated:** [May 1, 2021, 4:43pm UTC](https://discourse.processing.org/t/map-latitude-and-longitude-coordinates-to-a-an-image/29746 "2021-05-01T16:43:20Z")

</div>

Hi I’m trying to mark multiple points on a map using their latitude and longitude coordinates. I’ve written a for loop which gets these coordinates as well as population data from the CSV file but I’m unsure how I’d get …

---

## [Bug in logic for creating checkerboard grid](https://discourse.processing.org/t/bug-in-logic-for-creating-checkerboard-grid/29759)

<div class="topic-metadata">

**Author:** [@rikitiki](https://discourse.processing.org/u/rikitiki)\
**Replies:** 2\
**Last updated:** [April 30, 2021, 9:20pm UTC](https://discourse.processing.org/t/bug-in-logic-for-creating-checkerboard-grid/29759 "2021-04-30T21:20:25Z")

</div>

Hello, I’m hoping someone can find the flaw in my logic here. My goal is to create an even overlay checkerboard that has a transparency of 50. Here is my code in setup: background(255); int fillColor = 0; int gridDime…

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

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