# Coding Questions

**URL:** https://discourse.processing.org/c/p5js/p5js-questions/18.md?page=2

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

**Page:** 3

---

## [I can't make my lorenz attractor balls opaque help pls](https://discourse.processing.org/t/i-cant-make-my-lorenz-attractor-balls-opaque-help-pls/44599)

<div class="topic-metadata">

**Author:** [@mayara](https://discourse.processing.org/u/mayara)\
**Replies:** 3\
**Last updated:** [June 15, 2024, 1:10am UTC](https://discourse.processing.org/t/i-cant-make-my-lorenz-attractor-balls-opaque-help-pls/44599 "2024-06-15T01:10:37Z")

</div>

I want to make the balls in this code opaque but whenever I try the balls stop appearing help plssssssssss im going crazyyyyy :anguished: :anguished: :sob: :sob: :cry: :confounded: :confounded: \<let o = 10; let p = 28…

---

## [2D screen and 'world' position coordinates](https://discourse.processing.org/t/2d-screen-and-world-position-coordinates/44569)

<div class="topic-metadata">

**Author:** [@vkbr](https://discourse.processing.org/u/vkbr)\
**Replies:** 3\
**Last updated:** [June 10, 2024, 10:37pm UTC](https://discourse.processing.org/t/2d-screen-and-world-position-coordinates/44569 "2024-06-10T22:37:36Z")

</div>

I’m making a UI based on zooming and dragging (2d) . Basically I’m trying: function draw() { background(185, 175, 185); translate(width/2, height/2); scale(zoom); translate(dragPos.x , dragPos.y);…

---

## [Is there a way to set orbitControl() to only affect a specific mesh?](https://discourse.processing.org/t/is-there-a-way-to-set-orbitcontrol-to-only-affect-a-specific-mesh/44549)

<div class="topic-metadata">

**Author:** [@jshaw3](https://discourse.processing.org/u/jshaw3)\
**Replies:** 4\
**Last updated:** [June 9, 2024, 12:50pm UTC](https://discourse.processing.org/t/is-there-a-way-to-set-orbitcontrol-to-only-affect-a-specific-mesh/44549 "2024-06-09T12:50:48Z")

</div>

Is there a way to set orbitControl() to only affect a specific mesh? It doesn’t seem to be possible or a feature, but I wanted to throw the question out there in case there’s a way to implement it, and I just missed the…

---

## [Help thinking out an attraction behavior](https://discourse.processing.org/t/help-thinking-out-an-attraction-behavior/44537)

<div class="topic-metadata">

**Author:** [@vkbr](https://discourse.processing.org/u/vkbr)\
**Replies:** 7\
**Last updated:** [June 7, 2024, 1:31am UTC](https://discourse.processing.org/t/help-thinking-out-an-attraction-behavior/44537 "2024-06-07T01:31:45Z")

</div>

Hello. I’m wondering how, or if, I could make this idea happens. I’m have some code already, it’s based on @shiffman’s wonderful Nature of Code vectors and attractions chapters. Thanks Daniel, you are amazing! But not p…

---

## [Can't animate WEBGL model in draw loop](https://discourse.processing.org/t/cant-animate-webgl-model-in-draw-loop/29539)

<div class="topic-metadata">

**Author:** [@GreenCell](https://discourse.processing.org/u/GreenCell)\
**Replies:** 6\
**Last updated:** [May 28, 2024, 10:25pm UTC](https://discourse.processing.org/t/cant-animate-webgl-model-in-draw-loop/29539 "2024-05-28T22:25:57Z")

</div>

Hi, I’m loading 2 objs files with loadModel. Both objs have the same vert count, and because of this I’m trying to animate the verts to lerp from one model onto the other in the draw loop. I have direct access to the m…

---

## [Display P5JS scripts on RP 3B+](https://discourse.processing.org/t/display-p5js-scripts-on-rp-3b/44497)

<div class="topic-metadata">

**Author:** [@okabe02](https://discourse.processing.org/u/okabe02)\
**Replies:** 0\
**Last updated:** [May 27, 2024, 3:24pm UTC](https://discourse.processing.org/t/display-p5js-scripts-on-rp-3b/44497 "2024-05-27T15:24:33Z")

</div>

Hello, I am working on the last weeks on a project based on creative coding at the moment nothing fancy, I test some P5JS scripts on the RP¨and it worked, but right now I create a test, the browser generate a static im…

---

## [Shader File Paths in p5.js](https://discourse.processing.org/t/shader-file-paths-in-p5-js/44454)

<div class="topic-metadata">

**Author:** [@bdon](https://discourse.processing.org/u/bdon)\
**Replies:** 4\
**Last updated:** [May 22, 2024, 1:32pm UTC](https://discourse.processing.org/t/shader-file-paths-in-p5-js/44454 "2024-05-22T13:32:23Z")

</div>

Hi all - I just watched an excellent tutorial to get started with shaders (located here) - but I’m having some difficulty creating my “example.vert” and “example.frag” files in the basic Processing IDE. It works fine …

---

## [Help extending p5 and dependencies in web dev](https://discourse.processing.org/t/help-extending-p5-and-dependencies-in-web-dev/44421)

<div class="topic-metadata">

**Author:** [@vkbr](https://discourse.processing.org/u/vkbr)\
**Replies:** 13\
**Last updated:** [May 14, 2024, 5:19pm UTC](https://discourse.processing.org/t/help-extending-p5-and-dependencies-in-web-dev/44421 "2024-05-14T17:19:36Z")

</div>

I’m trying a big project, at least for my skills. I’ll reduce the question in a moment, but let me give a little context first. I have a server, in node, getting data from api and serving my client. Client side I’m bu…

---

## [someImage.mask (someMaskImage), not working (the mask is a createGraphic)](https://discourse.processing.org/t/someimage-mask-somemaskimage-not-working-the-mask-is-a-creategraphic/44395)

<div class="topic-metadata">

**Author:** [@vkbr](https://discourse.processing.org/u/vkbr)\
**Replies:** 2\
**Last updated:** [May 7, 2024, 11:16am UTC](https://discourse.processing.org/t/someimage-mask-somemaskimage-not-working-the-mask-is-a-creategraphic/44395 "2024-05-07T11:16:08Z")

</div>

Hey folks, Can you please have a look in this sketch at I can’t grasp why masking is not working. It simple, here is the code. (you can run it in the above link, image included) let face; // Variable to store the fa…

---

## [I need help with my flappy bird game (second round not working)](https://discourse.processing.org/t/i-need-help-with-my-flappy-bird-game-second-round-not-working/44328)

<div class="topic-metadata">

**Author:** [@Sterling](https://discourse.processing.org/u/Sterling)\
**Replies:** 3\
**Last updated:** [April 23, 2024, 5:45am UTC](https://discourse.processing.org/t/i-need-help-with-my-flappy-bird-game-second-round-not-working/44328 "2024-04-23T05:45:16Z")

</div>

Hi, so I’m very new to p5.js and I’m trying to make a basic flappy bird game with two levels. This is pretty much my first project in p5. So my first level is working how I want it to, if the player survives until the t…

---

## [Simple animation question about framerate and stepmotion](https://discourse.processing.org/t/simple-animation-question-about-framerate-and-stepmotion/44275)

<div class="topic-metadata">

**Author:** [@bcabc](https://discourse.processing.org/u/bcabc)\
**Replies:** 5\
**Last updated:** [April 21, 2024, 10:12am UTC](https://discourse.processing.org/t/simple-animation-question-about-framerate-and-stepmotion/44275 "2024-04-21T10:12:53Z")

</div>

hi there - i am attempting to make an ellipse that grows from a small size to a large size, over and over again. i like the effect it makes when it leaves an imprint of its stroke at each step, similar to how a tree sho…

---

## [Simulate book pages turning reacting to mouse (bezier)](https://discourse.processing.org/t/simulate-book-pages-turning-reacting-to-mouse-bezier/44284)

<div class="topic-metadata">

**Author:** [@slacle](https://discourse.processing.org/u/slacle)\
**Replies:** 21\
**Last updated:** [April 19, 2024, 8:24am UTC](https://discourse.processing.org/t/simulate-book-pages-turning-reacting-to-mouse-bezier/44284 "2024-04-19T08:24:48Z")

</div>

I’m trying to create a simulation of book pages that turn left or right depending on where the mouse is. Kind of as if the mouse is the wind and the pages go in its direction one by one. This is how it should look like: …

---

## [Applying Custom Shaders to Lines as Well as Filled Polygons in p5.js](https://discourse.processing.org/t/applying-custom-shaders-to-lines-as-well-as-filled-polygons-in-p5-js/44259)

<div class="topic-metadata">

**Author:** [@nakednous](https://discourse.processing.org/u/nakednous)\
**Replies:** 2\
**Last updated:** [April 9, 2024, 6:28pm UTC](https://discourse.processing.org/t/applying-custom-shaders-to-lines-as-well-as-filled-polygons-in-p5-js/44259 "2024-04-09T18:28:18Z")

</div>

Hi all, I’m using a custom shader in p5.js that works well on filled polygons but doesn’t affect the magenta lines outlining them. I’m looking for a way to apply the shader to these lines as well. Here’s my code: How …

---

## [I don't know the reason of this error](https://discourse.processing.org/t/i-dont-know-the-reason-of-this-error/44169)

<div class="topic-metadata">

**Author:** [@silverhee](https://discourse.processing.org/u/silverhee)\
**Replies:** 4\
**Last updated:** [March 28, 2024, 8:42am UTC](https://discourse.processing.org/t/i-dont-know-the-reason-of-this-error/44169 "2024-03-28T08:42:43Z")

</div>

hi. I want to make ‘matrix rain’ in p5js but… let symbols = \[\]; let symbolSize = 26; function setup() { createCanvas(window.innerWidth, window.innerHeight); background(0); let x = 0; for (let i = 0; i \<= width…

---

## [Bug when converting pixel into text value. ASCII](https://discourse.processing.org/t/bug-when-converting-pixel-into-text-value-ascii/44092)

<div class="topic-metadata">

**Author:** [@RomainGr](https://discourse.processing.org/u/RomainGr)\
**Replies:** 5\
**Last updated:** [March 17, 2024, 3:07pm UTC](https://discourse.processing.org/t/bug-when-converting-pixel-into-text-value-ascii/44092 "2024-03-17T15:07:35Z")

</div>

Hi, Sorry I’m unable to explain the issue I have in the title without showing the example. So here is the little p5 sketch and the version with the code When you drop an image it vectorises the image, something very …

---

## [Removing camera influence from shader](https://discourse.processing.org/t/removing-camera-influence-from-shader/44088)

<div class="topic-metadata">

**Author:** [@bdooley](https://discourse.processing.org/u/bdooley)\
**Replies:** 0\
**Last updated:** [March 12, 2024, 5:54pm UTC](https://discourse.processing.org/t/removing-camera-influence-from-shader/44088 "2024-03-12T17:54:00Z")

</div>

Hi all, This is a bit of a two-part question: I’m working on a sketch of falling 3D cubes that uses cannon.js and shaders. I currently have a shader applied that creates a gradient on each face based on the vertex posi…

---

## [Unable to apply filter to a capture from the webcam](https://discourse.processing.org/t/unable-to-apply-filter-to-a-capture-from-the-webcam/44045)

<div class="topic-metadata">

**Author:** [@RomainGr](https://discourse.processing.org/u/RomainGr)\
**Replies:** 10\
**Last updated:** [March 12, 2024, 5:41pm UTC](https://discourse.processing.org/t/unable-to-apply-filter-to-a-capture-from-the-webcam/44045 "2024-03-12T17:41:21Z")

</div>

Hi, I’m trying to apply filter using the filter() ( eg: filter(GRAY) ), the problem I have is that it applies the filter to the whole Canvas instead of only the “selected” element. So what I’m doing exactly is capturin…

---

## [How to create the below image using p5.js](https://discourse.processing.org/t/how-to-create-the-below-image-using-p5-js/43951)

<div class="topic-metadata">

**Author:** [@m00n620](https://discourse.processing.org/u/m00n620)\
**Replies:** 1\
**Last updated:** [February 20, 2024, 12:40pm UTC](https://discourse.processing.org/t/how-to-create-the-below-image-using-p5-js/43951 "2024-02-20T12:40:50Z")

</div>

How to generate this art? Please help!

---

## [Looping several videos](https://discourse.processing.org/t/looping-several-videos/43854)

<div class="topic-metadata">

**Author:** [@uili](https://discourse.processing.org/u/uili)\
**Replies:** 2\
**Last updated:** [February 19, 2024, 11:54am UTC](https://discourse.processing.org/t/looping-several-videos/43854 "2024-02-19T11:54:20Z")

</div>

https://editor.p5js.org/guillermo\_d/sketches/jMAtBLViX Hello!! I have three videos in this sketch, but i only get the first one to loop. I need to make a loop with the three videos. I’ve been trying different options an…

---

## [Failed To Fetch Error](https://discourse.processing.org/t/failed-to-fetch-error/43027)

<div class="topic-metadata">

**Author:** [@eharkins](https://discourse.processing.org/u/eharkins)\
**Replies:** 11\
**Last updated:** [February 17, 2024, 6:43pm UTC](https://discourse.processing.org/t/failed-to-fetch-error/43027 "2024-02-17T18:43:22Z")

</div>

I am a teacher of a beginning coding class in P5 and our class project is to create a themed Maze Game with all the typical features of a maze. Since the students need to pick a theme, I’ve asked them to upload and displ…

---

## [P5.js Using Shaders with FrameBuffers](https://discourse.processing.org/t/p5-js-using-shaders-with-framebuffers/43874)

<div class="topic-metadata">

**Author:** [@prontopablo](https://discourse.processing.org/u/prontopablo)\
**Replies:** 3\
**Last updated:** [February 16, 2024, 10:58am UTC](https://discourse.processing.org/t/p5-js-using-shaders-with-framebuffers/43874 "2024-02-16T10:58:56Z")

</div>

Hi all! I’m trying to use p5.js framebuffers with shaders. I have had success with other shaders but this threshold shader and a few other similar ones I have only work for a moment and then the screen fades to black. I…

---

## [Reaction Diffusion Shader Implementation (problems)](https://discourse.processing.org/t/reaction-diffusion-shader-implementation-problems/43879)

<div class="topic-metadata">

**Author:** [@JorgeRando](https://discourse.processing.org/u/JorgeRando)\
**Replies:** 7\
**Last updated:** [February 12, 2024, 9:38pm UTC](https://discourse.processing.org/t/reaction-diffusion-shader-implementation-problems/43879 "2024-02-12T21:38:44Z")

</div>

Hi there! I’m working on an implementation of the well-known reaction-diffusion model with p5 shaders. However, I’m experiencing issues because the model seems to work, but after a few iterations, it gets stuck and stops…

---

## [Webcam view is tiny](https://discourse.processing.org/t/webcam-view-is-tiny/43870)

<div class="topic-metadata">

**Author:** [@Infi](https://discourse.processing.org/u/Infi)\
**Replies:** 0\
**Last updated:** [February 9, 2024, 9:33pm UTC](https://discourse.processing.org/t/webcam-view-is-tiny/43870 "2024-02-09T21:33:10Z")

</div>

Hello! I am in a desperate need of simple app that can be used as a camera color filter, e.g. shows only red values while rest is 0. I have been doing this with shaders. The effect itself works but the problem is that t…

---

## [keyTyped() not responding in p5.js editor](https://discourse.processing.org/t/keytyped-not-responding-in-p5-js-editor/43582)

<div class="topic-metadata">

**Author:** [@Ignotus](https://discourse.processing.org/u/Ignotus)\
**Replies:** 3\
**Last updated:** [January 19, 2024, 10:11pm UTC](https://discourse.processing.org/t/keytyped-not-responding-in-p5-js-editor/43582 "2024-01-19T22:11:37Z")

</div>

I have some code in the p5.js editor that is not responding to keyTyped() or keyPressed() events. A slider interface element is also not responding. Possibly it’s an issue with the browser, but other interface elements d…

---

## [Bug in my code\_ Circle Overlap](https://discourse.processing.org/t/bug-in-my-code-circle-overlap/43716)

<div class="topic-metadata">

**Author:** [@Jiji](https://discourse.processing.org/u/Jiji)\
**Replies:** 3\
**Last updated:** [January 19, 2024, 4:10pm UTC](https://discourse.processing.org/t/bug-in-my-code-circle-overlap/43716 "2024-01-19T16:10:25Z")

</div>

Hi y’all, I am trying to make a test when 2 circles overlapped, then it should change color background. But for some reason, the background always changes color when the circles are closed and not overlapped yet. Unless…

---

## [RangeError: Array buffer allocation failed at \_generateGlobalPalette](https://discourse.processing.org/t/rangeerror-array-buffer-allocation-failed-at-generateglobalpalette/43691)

<div class="topic-metadata">

**Author:** [@laya](https://discourse.processing.org/u/laya)\
**Replies:** 4\
**Last updated:** [January 15, 2024, 7:14am UTC](https://discourse.processing.org/t/rangeerror-array-buffer-allocation-failed-at-generateglobalpalette/43691 "2024-01-15T07:14:23Z")

</div>

Keep getting RangeError when saving the gif. Frames would be saved, but will get stuck in generating color palette (pic 1). Here’s my code: Here’s the error:

---

## [Need help with wifi mesh network simulation code bug](https://discourse.processing.org/t/need-help-with-wifi-mesh-network-simulation-code-bug/43662)

<div class="topic-metadata">

**Author:** [@michaelberge](https://discourse.processing.org/u/michaelberge)\
**Replies:** 0\
**Last updated:** [January 9, 2024, 6:33pm UTC](https://discourse.processing.org/t/need-help-with-wifi-mesh-network-simulation-code-bug/43662 "2024-01-09T18:33:16Z")

</div>

INTRODUCTION: Hey everyone, I am working on a simulation for a wifi mesh algorithm before implementing on a prototype for a client. The code below is the whole program, it’s a little long for a forum post, but I didn’t …

---

## [Quadtrees image compression](https://discourse.processing.org/t/quadtrees-image-compression/12481)

<div class="topic-metadata">

**Author:** [@TimoL](https://discourse.processing.org/u/TimoL)\
**Replies:** 5\
**Last updated:** [January 9, 2024, 7:01am UTC](https://discourse.processing.org/t/quadtrees-image-compression/12481 "2024-01-09T07:01:14Z")

</div>

Hi everybody, Long time/first time… Im trying to create a Quadtree image compression using processing. I’ve tried to follow Daniel Shiffmans coding challenge on quadtree data structure but I get lost. I understand th…

---

## [How to connect p5.js web editor database to my mongoDB GUI](https://discourse.processing.org/t/how-to-connect-p5-js-web-editor-database-to-my-mongodb-gui/43594)

<div class="topic-metadata">

**Author:** [@DNotNice](https://discourse.processing.org/u/DNotNice)\
**Replies:** 1\
**Last updated:** [January 1, 2024, 8:36am UTC](https://discourse.processing.org/t/how-to-connect-p5-js-web-editor-database-to-my-mongodb-gui/43594 "2024-01-01T08:36:34Z")

</div>

I wanted to see how the project stores data in mongodb database so I followed all the steps as provided in the contributer docs and built the project using Docker .Everything works fine , but can anyone tell me how can I…

---

## [Make canvas transparent (or how to include a background image)](https://discourse.processing.org/t/make-canvas-transparent-or-how-to-include-a-background-image/43572)

<div class="topic-metadata">

**Author:** [@Bastilling](https://discourse.processing.org/u/Bastilling)\
**Replies:** 2\
**Last updated:** [December 29, 2023, 9:17pm UTC](https://discourse.processing.org/t/make-canvas-transparent-or-how-to-include-a-background-image/43572 "2023-12-29T21:17:37Z")

</div>

Hey everyone! I am currently working on a webpage as a sort of late christmas present and I can not figure out the solution for a specific design problem. Since I am unexperienced with html/css stuff, I wanted to ask so…

[Previous page](https://discourse.processing.org/c/p5js/p5js-questions/18.md?page=1)

[Next page](https://discourse.processing.org/c/p5js/p5js-questions/18.md?page=3)
