# Coding Questions

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

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

**Page:** 82

---

## [Multiple windows with idle for user response](https://discourse.processing.org/t/multiple-windows-with-idle-for-user-response/23660)

<div class="topic-metadata">

**Author:** [@MiguelSanches](https://discourse.processing.org/u/MiguelSanches)\
**Replies:** 0\
**Last updated:** [September 3, 2020, 2:18pm UTC](https://discourse.processing.org/t/multiple-windows-with-idle-for-user-response/23660 "2020-09-03T14:18:43Z")

</div>

Hi all, I was wondering if it is possible with processing to create a second window but with blocking implementation. I know that Processing examples as a multiple window sketch, but in that example, I can interact wit…

---

## [Pong Trail Question](https://discourse.processing.org/t/pong-trail-question/23718)

<div class="topic-metadata">

**Author:** [@FloorBean](https://discourse.processing.org/u/FloorBean)\
**Replies:** 7\
**Last updated:** [September 7, 2020, 2:18am UTC](https://discourse.processing.org/t/pong-trail-question/23718 "2020-09-07T02:18:03Z")

</div>

Hi, I am making a variation of pong, and I want to make the ball have a trail when I press my mouse. I conceptually know this means I need to stop my background from updating, but I am having difficulty in having this ac…

---

## [Full Screen application performance](https://discourse.processing.org/t/full-screen-application-performance/21760)

<div class="topic-metadata">

**Author:** [@mgood7123](https://discourse.processing.org/u/mgood7123)\
**Replies:** 8\
**Last updated:** [September 6, 2020, 10:28pm UTC](https://discourse.processing.org/t/full-screen-application-performance/21760 "2020-09-06T22:28:32Z")

</div>

what would some techiques be for optiming full screen application performance? in particular with a lot of image(PGraphicsObjectInstance) calls with a 400x400 size and 4 Window objects being rendered i can achieve 60FPS…

---

## [How can I get this halftone effect on a folder containing images, and then export them to another folder?](https://discourse.processing.org/t/how-can-i-get-this-halftone-effect-on-a-folder-containing-images-and-then-export-them-to-another-folder/23711)

<div class="topic-metadata">

**Author:** [@gatz\_gaz](https://discourse.processing.org/u/gatz_gaz)\
**Replies:** 3\
**Last updated:** [September 6, 2020, 6:17pm UTC](https://discourse.processing.org/t/how-can-i-get-this-halftone-effect-on-a-folder-containing-images-and-then-export-them-to-another-folder/23711 "2020-09-06T18:17:59Z")

</div>

---

## [I would like to use the badwitch effect on the images in the "date" folder and export it to the "output" folder](https://discourse.processing.org/t/i-would-like-to-use-the-badwitch-effect-on-the-images-in-the-date-folder-and-export-it-to-the-output-folder/23698)

<div class="topic-metadata">

**Author:** [@gatz\_gaz](https://discourse.processing.org/u/gatz_gaz)\
**Replies:** 6\
**Last updated:** [September 6, 2020, 5:25pm UTC](https://discourse.processing.org/t/i-would-like-to-use-the-badwitch-effect-on-the-images-in-the-date-folder-and-export-it-to-the-output-folder/23698 "2020-09-06T17:25:23Z")

</div>

please format code with \</\> button \* homework policy \* asking questions PImage foto; int maxImages = 4; // Img in totale int imageIndex = 0; // Img iniziale PImage images = new PImage\[maxImages\]; // Serie di Img …

---

## [Keeping a ball within bounds](https://discourse.processing.org/t/keeping-a-ball-within-bounds/23700)

<div class="topic-metadata">

**Author:** [@FloorBean](https://discourse.processing.org/u/FloorBean)\
**Replies:** 3\
**Last updated:** [September 6, 2020, 7:35am UTC](https://discourse.processing.org/t/keeping-a-ball-within-bounds/23700 "2020-09-06T07:35:58Z")

</div>

I am trying to keep the ball in the display window and it only is sometimes working. I am not really sure where to go from here. (Ignore the paddle for now). float gap; //Assign variables float ballX = random(300); …

---

## [HeatMap colours without if else](https://discourse.processing.org/t/heatmap-colours-without-if-else/23670)

<div class="topic-metadata">

**Author:** [@tribblesontoast](https://discourse.processing.org/u/tribblesontoast)\
**Replies:** 1\
**Last updated:** [September 5, 2020, 10:12am UTC](https://discourse.processing.org/t/heatmap-colours-without-if-else/23670 "2020-09-05T10:12:12Z")

</div>

Hi, I’m working on a heat map and I’m trying to improve my colour code. I have a grid of squares with each having a value for the heat map, based on that value I have been assigning a colour from an array. I have been …

---

## [Is there a 'Search period' or 'Date search' interface?](https://discourse.processing.org/t/is-there-a-search-period-or-date-search-interface/22582)

<div class="topic-metadata">

**Author:** [@GWAK](https://discourse.processing.org/u/GWAK)\
**Replies:** 19\
**Last updated:** [September 5, 2020, 1:26am UTC](https://discourse.processing.org/t/is-there-a-search-period-or-date-search-interface/22582 "2020-09-05T01:26:52Z")

</div>

If you look at the picture, you can search for time as above. Is there an interface library or source code like that? help me.

---

## ["zoom" into image based on window center only](https://discourse.processing.org/t/zoom-into-image-based-on-window-center-only/23647)

<div class="topic-metadata">

**Author:** [@jetjaguar](https://discourse.processing.org/u/jetjaguar)\
**Replies:** 3\
**Last updated:** [September 4, 2020, 3:53pm UTC](https://discourse.processing.org/t/zoom-into-image-based-on-window-center-only/23647 "2020-09-04T15:53:01Z")

</div>

Hello everyone! I am trying to create the effect of zooming in on an image based on the center of the program window, NOT based on the center of an image whose mode has been set to CENTER. The code below shows what hap…

---

## [Unable to load fonts using createFont()](https://discourse.processing.org/t/unable-to-load-fonts-using-createfont/23666)

<div class="topic-metadata">

**Author:** [@Lucianoinfanti](https://discourse.processing.org/u/Lucianoinfanti)\
**Replies:** 3\
**Last updated:** [September 4, 2020, 1:03pm UTC](https://discourse.processing.org/t/unable-to-load-fonts-using-createfont/23666 "2020-09-04T13:03:22Z")

</div>

I tried to load a few different fonts I have inside my data folder but to no success. This is my code: PGraphics pg; void setup() { PFont font = createFont("ZapfDingbats.ttf", 100); size(800,800, P2D); pg = creat…

---

## [Ploting a shape along a path](https://discourse.processing.org/t/ploting-a-shape-along-a-path/23641)

<div class="topic-metadata">

**Author:** [@pandl](https://discourse.processing.org/u/pandl)\
**Replies:** 4\
**Last updated:** [September 3, 2020, 11:01pm UTC](https://discourse.processing.org/t/ploting-a-shape-along-a-path/23641 "2020-09-03T23:01:04Z")

</div>

I’ve able to have a shape follow a circular path and now I’d like to do the same thing with other paths starting with a straight line. I once had some BASIC code that plotted a line but that was 40 odd years ago and I ca…

---

## [Beginner having problems, for cycle, lines coordinates](https://discourse.processing.org/t/beginner-having-problems-for-cycle-lines-coordinates/23659)

<div class="topic-metadata">

**Author:** [@TabeaErre](https://discourse.processing.org/u/TabeaErre)\
**Replies:** 1\
**Last updated:** [September 3, 2020, 3:24pm UTC](https://discourse.processing.org/t/beginner-having-problems-for-cycle-lines-coordinates/23659 "2020-09-03T15:24:28Z")

</div>

Hi everybody, I’m very new to processing. I’m trying to finish this code, my uni professor told me I had to do a “for cycle” to draw all the lines using the coordinates. I don’t know how to do it, I’m stuck. Also after t…

---

## [Menu toolbar and custom events](https://discourse.processing.org/t/menu-toolbar-and-custom-events/23653)

<div class="topic-metadata">

**Author:** [@MiguelSanches](https://discourse.processing.org/u/MiguelSanches)\
**Replies:** 0\
**Last updated:** [September 3, 2020, 8:22am UTC](https://discourse.processing.org/t/menu-toolbar-and-custom-events/23653 "2020-09-03T08:22:44Z")

</div>

Hi all, I have been trying to work and play with creating a menu toolbar. I recently found this post (https://forum.processing.org/two/discussion/21749/how-to-create-an-application-with-a-toolbar) and I have used some …

---

## [Moving a cursor with Robot makes it skip across the window?](https://discourse.processing.org/t/moving-a-cursor-with-robot-makes-it-skip-across-the-window/23373)

<div class="topic-metadata">

**Author:** [@CosmicCrowMC](https://discourse.processing.org/u/CosmicCrowMC)\
**Replies:** 5\
**Last updated:** [September 3, 2020, 2:11am UTC](https://discourse.processing.org/t/moving-a-cursor-with-robot-makes-it-skip-across-the-window/23373 "2020-09-03T02:11:21Z")

</div>

So, I’ve been working on a 3d game for quite a while now. It’s first-person, and you look around by moving the mouse - makes sense. I’ve sent the game to some friends to playtest, and it works fine for all but one of the…

---

## [Display objects in their original size \[SOLVED\]](https://discourse.processing.org/t/display-objects-in-their-original-size-solved/23622)

<div class="topic-metadata">

**Author:** [@SamTech](https://discourse.processing.org/u/SamTech)\
**Replies:** 3\
**Last updated:** [September 2, 2020, 5:36pm UTC](https://discourse.processing.org/t/display-objects-in-their-original-size-solved/23622 "2020-09-02T17:36:54Z")

</div>

Hey there! I have programmed an P3D Simulation and need to display some objects in the size I have initialized them so they appear to stay the same size even if I move my camera away from them. I think there is somewhere…

---

## [Window resize (aka surface.resizable) not functioning in P2D and P3D modes](https://discourse.processing.org/t/window-resize-aka-surface-resizable-not-functioning-in-p2d-and-p3d-modes/23586)

<div class="topic-metadata">

**Author:** [@Tarik](https://discourse.processing.org/u/Tarik)\
**Replies:** 3\
**Last updated:** [September 1, 2020, 11:23am UTC](https://discourse.processing.org/t/window-resize-aka-surface-resizable-not-functioning-in-p2d-and-p3d-modes/23586 "2020-09-01T11:23:59Z")

</div>

Hi all, On windows, surface.setResizable(true) has no effect whatsoever when the sketch runs in P2D or P3D mode. In the default mode, everything runs as expected. Are there any known solutions? thanks! -t (and here’s…

---

## [Bringing the composition back](https://discourse.processing.org/t/bringing-the-composition-back/23596)

<div class="topic-metadata">

**Author:** [@yhlaskerimov](https://discourse.processing.org/u/yhlaskerimov)\
**Replies:** 0\
**Last updated:** [September 1, 2020, 6:38am UTC](https://discourse.processing.org/t/bringing-the-composition-back/23596 "2020-09-01T06:38:23Z")

</div>

Hi, everyone ! I challenged myself to do things like Andre burnier is doing. And I don’t know how he is bringing back his compostions: 1st example 2nd example Can anyone help ?

---

## [\[SOLVED\] Texture Mapping in Custom Fragment Shader for Shadow Mapping](https://discourse.processing.org/t/solved-texture-mapping-in-custom-fragment-shader-for-shadow-mapping/23533)

<div class="topic-metadata">

**Author:** [@Shwaa](https://discourse.processing.org/u/Shwaa)\
**Replies:** 0\
**Last updated:** [August 28, 2020, 2:19pm UTC](https://discourse.processing.org/t/solved-texture-mapping-in-custom-fragment-shader-for-shadow-mapping/23533 "2020-08-28T14:19:46Z")

</div>

Hello, I have been using a shadow mapping shader posted in this old forum thread that I slightly modified to better suit the game I am making. My modifications include clamping the shadow darkness so colors don’t become…

---

## [Two questions on for loops and randomize translate](https://discourse.processing.org/t/two-questions-on-for-loops-and-randomize-translate/23567)

<div class="topic-metadata">

**Author:** [@Huno](https://discourse.processing.org/u/Huno)\
**Replies:** 10\
**Last updated:** [August 31, 2020, 9:53pm UTC](https://discourse.processing.org/t/two-questions-on-for-loops-and-randomize-translate/23567 "2020-08-31T21:53:44Z")

</div>

The first question is regarding this simple for loop on translate, What I am trying to achieve is to have a line appear in random places in the canvas with translate, but when I do a for loop, I get a constant line at th…

---

## [How to embed processing sketch onto GoDaddy Website](https://discourse.processing.org/t/how-to-embed-processing-sketch-onto-godaddy-website/23570)

<div class="topic-metadata">

**Author:** [@squirtlekid1000](https://discourse.processing.org/u/squirtlekid1000)\
**Replies:** 1\
**Last updated:** [August 30, 2020, 10:43pm UTC](https://discourse.processing.org/t/how-to-embed-processing-sketch-onto-godaddy-website/23570 "2020-08-30T22:43:29Z")

</div>

Hi there, I’m trying to copy the HTML code of a Processing Sketch onto my website (made via GoDaddy) but I’m not getting a result (i.e. the only thing that is coming up is the written code rather than the embedded sketc…

---

## [Make perlin noise loop duration coincide with frame duration for looping GIF](https://discourse.processing.org/t/make-perlin-noise-loop-duration-coincide-with-frame-duration-for-looping-gif/23454)

<div class="topic-metadata">

**Author:** [@Leonsuper](https://discourse.processing.org/u/Leonsuper)\
**Replies:** 2\
**Last updated:** [August 29, 2020, 8:47pm UTC](https://discourse.processing.org/t/make-perlin-noise-loop-duration-coincide-with-frame-duration-for-looping-gif/23454 "2020-08-29T20:47:57Z")

</div>

Hello, I didn’t wanna ask two questions in such a short time, but I’ve been having a doubt related to two videos by The Coding Train, “Polar Perlin Noise Loops” and “Perlin Noise GIF Loops”. I tried to mix the two but i…

---

## [Trying to eliminate draw flicker](https://discourse.processing.org/t/trying-to-eliminate-draw-flicker/23530)

<div class="topic-metadata">

**Author:** [@pandl](https://discourse.processing.org/u/pandl)\
**Replies:** 5\
**Last updated:** [August 28, 2020, 9:00pm UTC](https://discourse.processing.org/t/trying-to-eliminate-draw-flicker/23530 "2020-08-28T21:00:22Z")

</div>

Thank you for reading this. I had this working reasonably well several months ago but I must have forgotten to save the project. I had the moon orbiting the earth and the earth orbiting the sun with minimal flicker. I’v…

---

## [Creating a light source in 2D world](https://discourse.processing.org/t/creating-a-light-source-in-2d-world/23528)

<div class="topic-metadata">

**Author:** [@xSimas](https://discourse.processing.org/u/xSimas)\
**Replies:** 3\
**Last updated:** [August 28, 2020, 5:30pm UTC](https://discourse.processing.org/t/creating-a-light-source-in-2d-world/23528 "2020-08-28T17:30:19Z")

</div>

Hi. I’m trying to create a light source in 2D. As an example, take a game character in 2D world that is holding a torch in a dark cave and there’s some area around him that’s fully lit up and then it gets darker (as the …

---

## [That's strange! Detect mouse inside a box?](https://discourse.processing.org/t/thats-strange-detect-mouse-inside-a-box/23443)

<div class="topic-metadata">

**Author:** [@HumanoidX](https://discourse.processing.org/u/HumanoidX)\
**Replies:** 10\
**Last updated:** [August 28, 2020, 12:41pm UTC](https://discourse.processing.org/t/thats-strange-detect-mouse-inside-a-box/23443 "2020-08-28T12:41:34Z")

</div>

I remember that I did that in a Periodic Table program before, my Dad accidentally deleted the D: drive in my computer and everything inside got lost. This is my code: boolean mouseIsBetween(float x1,float y1,float x2,…

---

## [strokeWeight() acting strangely with FX2D](https://discourse.processing.org/t/strokeweight-acting-strangely-with-fx2d/23423)

<div class="topic-metadata">

**Author:** [@ketchupmustard](https://discourse.processing.org/u/ketchupmustard)\
**Replies:** 2\
**Last updated:** [August 28, 2020, 8:16am UTC](https://discourse.processing.org/t/strokeweight-acting-strangely-with-fx2d/23423 "2020-08-28T08:16:06Z")

</div>

Hey y’all. I was gonna post my code but I noticed it’s resolved once I get rid of FX2D in my fullscreen() declaration. Basically I couldn’t seem to selectively change the strokeWeight - I couldn’t change certain elemen…

---

## [Get average heading](https://discourse.processing.org/t/get-average-heading/23483)

<div class="topic-metadata">

**Author:** [@TimoL](https://discourse.processing.org/u/TimoL)\
**Replies:** 8\
**Last updated:** [August 27, 2020, 4:41pm UTC](https://discourse.processing.org/t/get-average-heading/23483 "2020-08-27T16:41:04Z")

</div>

I have another maths/coding question. Im trying to figure out the average heading of an array of PVectors. At first I tried adding up the heading values and dividing that by the count. But there are scenarios where th…

---

## [How to Plot a Mandelbulb](https://discourse.processing.org/t/how-to-plot-a-mandelbulb/23490)

<div class="topic-metadata">

**Author:** [@rubbs](https://discourse.processing.org/u/rubbs)\
**Replies:** 12\
**Last updated:** [August 27, 2020, 2:25pm UTC](https://discourse.processing.org/t/how-to-plot-a-mandelbulb/23490 "2020-08-27T14:25:42Z")

</div>

Hello, I am trying to recreate the mandelbulb in processing (a 3D version of the mandelbrot set). I have looked through multiple sites for the equations to plot but they are different depending on the site. I am also st…

---

## [Problem with Selection Sort?](https://discourse.processing.org/t/problem-with-selection-sort/23506)

<div class="topic-metadata">

**Author:** [@Brucef](https://discourse.processing.org/u/Brucef)\
**Replies:** 2\
**Last updated:** [August 27, 2020, 7:32am UTC](https://discourse.processing.org/t/problem-with-selection-sort/23506 "2020-08-27T07:32:28Z")

</div>

The Selection Sort coded below does not sort correctly. The numbers 7,66,5,40,33,99 are entered into an array called nums\[ \]. When the program is run they do not sort from low to high? Certain sequences will sort, such…

---

## [Problem with wraparound when using beginShape()](https://discourse.processing.org/t/problem-with-wraparound-when-using-beginshape/23511)

<div class="topic-metadata">

**Author:** [@mruts](https://discourse.processing.org/u/mruts)\
**Replies:** 0\
**Last updated:** [August 26, 2020, 9:39pm UTC](https://discourse.processing.org/t/problem-with-wraparound-when-using-beginshape/23511 "2020-08-26T21:39:45Z")

</div>

Hi, I’m trying to adapt this code (from Daniel Shiffman). It uses an image to generate a flow field, then draw lines following the field. The issue I’m having (I think) is in void borders() in the Vehicle class. When th…

---

## [Collision shape after rotate](https://discourse.processing.org/t/collision-shape-after-rotate/23426)

<div class="topic-metadata">

**Author:** [@NoName](https://discourse.processing.org/u/NoName)\
**Replies:** 1\
**Last updated:** [August 26, 2020, 8:29pm UTC](https://discourse.processing.org/t/collision-shape-after-rotate/23426 "2020-08-26T20:29:19Z")

</div>

Please explain to me how you can check the collision of rectangular shapes after they have been rotated. Question number 2. How to correctly get the vertex of the shape after rotation? I have after getVertex() a point …

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

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