# p5.js

**URL:** https://discourse.processing.org/c/p5js/10.md?page=6

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

**Page:** 7

---

## [App architecture advice wanted. :) - \*\*improved question \*\*](https://discourse.processing.org/t/app-architecture-advice-wanted-improved-question/44573)

<div class="topic-metadata">

**Author:** [@vkbr](https://discourse.processing.org/u/vkbr)\
**Replies:** 0\
**Last updated:** [June 10, 2024, 10:49pm UTC](https://discourse.processing.org/t/app-architecture-advice-wanted-improved-question/44573 "2024-06-10T22:49:38Z")

</div>

Ok, I managed to build my view logic. Sorry, let me start over. I’m making a visualization of Brasil’s congress. There is the server, which querys the api, get and store data, process pictures and serve all of this. I…

---

## [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…

---

## [amplitude.getLevel() always returns 0](https://discourse.processing.org/t/amplitude-getlevel-always-returns-0/44521)

<div class="topic-metadata">

**Author:** [@RomainGr](https://discourse.processing.org/u/RomainGr)\
**Replies:** 0\
**Last updated:** [June 1, 2024, 9:05am UTC](https://discourse.processing.org/t/amplitude-getlevel-always-returns-0/44521 "2024-06-01T09:05:59Z")

</div>

I’m building a little sound visualiser, but I’m strictly unable to get the amplitude level, it always return 0, and I have no idea why. I have no problem accessing fft, so it seems that there is no issue accessing the mi…

---

## [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…

---

## [Confuse about issue template](https://discourse.processing.org/t/confuse-about-issue-template/44492)

<div class="topic-metadata">

**Author:** [@rdrahul05](https://discourse.processing.org/u/rdrahul05)\
**Replies:** 1\
**Last updated:** [May 27, 2024, 10:46am UTC](https://discourse.processing.org/t/confuse-about-issue-template/44492 "2024-05-27T10:46:12Z")

</div>

Actually, I have open my first issue in P5js web editor and after opening my first issue welcome bot have suggest me to see the issue template, is it issue tab of the github repository or something else?

---

## [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 …

---

## [Which library do you recommend to add OSC communication to p5js?](https://discourse.processing.org/t/which-library-do-you-recommend-to-add-osc-communication-to-p5js/44420)

<div class="topic-metadata">

**Author:** [@amundsen](https://discourse.processing.org/u/amundsen)\
**Replies:** 19\
**Last updated:** [May 20, 2024, 8:22pm UTC](https://discourse.processing.org/t/which-library-do-you-recommend-to-add-osc-communication-to-p5js/44420 "2024-05-20T20:22:29Z")

</div>

Hello, I want to add Open Sound Control (OSC) communication to my p5js sketches. Which library do you recommend for this purpose? Thank you.

---

## [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…

---

## [P5 for Spatial Computing / Mixed Reality / p5xr](https://discourse.processing.org/t/p5-for-spatial-computing-mixed-reality-p5xr/44043)

<div class="topic-metadata">

**Author:** [@TiborUdvari](https://discourse.processing.org/u/TiborUdvari)\
**Replies:** 19\
**Last updated:** [May 14, 2024, 3:12pm UTC](https://discourse.processing.org/t/p5-for-spatial-computing-mixed-reality-p5xr/44043 "2024-05-14T15:12:16Z")

</div>

I’m exploring p5 and p5xr to do Spatial Computing or Mixed Reality. Do you know any people who are working with p5 in 3D? Most examples use game engines like Unity or maybe Zach Lieberman’s work with ARKit and OpenFrame…

---

## [My Pacman Game issues](https://discourse.processing.org/t/my-pacman-game-issues/6806)

<div class="topic-metadata">

**Author:** [@CodeOscar](https://discourse.processing.org/u/CodeOscar)\
**Replies:** 7\
**Last updated:** [May 14, 2024, 2:56pm UTC](https://discourse.processing.org/t/my-pacman-game-issues/6806 "2024-05-14T14:56:23Z")

</div>

I have a problem about when I want to press a key, up, down, right and left, change the image of my Pacman, depending on its position, with different animated sprites, which are in different images, according to their po…

---

## [Converting from Processing to p5.js](https://discourse.processing.org/t/converting-from-processing-to-p5-js/38394)

<div class="topic-metadata">

**Author:** [@Tilman](https://discourse.processing.org/u/Tilman)\
**Replies:** 8\
**Last updated:** [May 8, 2024, 9:05pm UTC](https://discourse.processing.org/t/converting-from-processing-to-p5-js/38394 "2024-05-08T21:05:12Z")

</div>

Hi! I have a small little noise graphing code I would love to port to p5.js and have a hard time finding out what needs to change so this code (which works in processing) works in p5.js float inc = 0.05; float start = 0…

---

## [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 Made an ES6 Typescript and Parcel template for others to fork](https://discourse.processing.org/t/i-made-an-es6-typescript-and-parcel-template-for-others-to-fork/44379)

<div class="topic-metadata">

**Author:** [@ehonzik](https://discourse.processing.org/u/ehonzik)\
**Replies:** 7\
**Last updated:** [May 6, 2024, 6:40pm UTC](https://discourse.processing.org/t/i-made-an-es6-typescript-and-parcel-template-for-others-to-fork/44379 "2024-05-06T18:40:43Z")

</div>

Hi all, recently I’ve gotten into p5js and have been really enjoying it. Thing is, I don’t come from a web development background. I’m used to languages like C# and Go with all of the built in intellisense, tooling, and …

---

## [\[p5.js editor\] Bad gateway error](https://discourse.processing.org/t/p5-js-editor-bad-gateway-error/44338)

<div class="topic-metadata">

**Author:** [@sambushes](https://discourse.processing.org/u/sambushes)\
**Replies:** 15\
**Last updated:** [May 6, 2024, 1:27pm UTC](https://discourse.processing.org/t/p5-js-editor-bad-gateway-error/44338 "2024-05-06T13:27:33Z")

</div>

I´m constantly getting bad gateway error come up the last couple of days …and my students are too. Is anyone else getting this? I can´t see any open issues about it on Github.

---

## [\[p5 WEB\] I would like to save ‘saveFrames’ (current WEB screen) into one image variable](https://discourse.processing.org/t/p5-web-i-would-like-to-save-saveframes-current-web-screen-into-one-image-variable/44381)

<div class="topic-metadata">

**Author:** [@GWAK](https://discourse.processing.org/u/GWAK)\
**Replies:** 3\
**Last updated:** [May 4, 2024, 11:58am UTC](https://discourse.processing.org/t/p5-web-i-would-like-to-save-saveframes-current-web-screen-into-one-image-variable/44381 "2024-05-04T11:58:05Z")

</div>

\[p5 WEB\] I would like to save ‘saveFrames’ (current WEB screen) into one image variable. hello. Nice to meet you. I would like to save the image of the current WEB screen in a variable. I would like to edit and sa…

---

## [Run python script server-side from P5.js sketch](https://discourse.processing.org/t/run-python-script-server-side-from-p5-js-sketch/44380)

<div class="topic-metadata">

**Author:** [@bananana](https://discourse.processing.org/u/bananana)\
**Replies:** 3\
**Last updated:** [May 4, 2024, 8:24am UTC](https://discourse.processing.org/t/run-python-script-server-side-from-p5-js-sketch/44380 "2024-05-04T08:24:01Z")

</div>

I’m a bit of a noob when it comes to P5.js and web stuff so apologies in advance for the possibly dumb question: I have p5.js sketch that I have online a hosted linux server. I want this p5.js app to call a python scrip…

---

## [G4js - developing a new GUI library for p5.js (now called canvasGUI)](https://discourse.processing.org/t/g4js-developing-a-new-gui-library-for-p5-js-now-called-canvasgui/36116)

<div class="topic-metadata">

**Author:** [@quark](https://discourse.processing.org/u/quark)\
**Replies:** 11\
**Last updated:** [May 3, 2024, 9:36am UTC](https://discourse.processing.org/t/g4js-developing-a-new-gui-library-for-p5-js-now-called-canvasgui/36116 "2024-05-03T09:36:55Z")

</div>

I released G4P for Javamode just over 13 years ago but now I am getting into Javascript I intend to create a GUI library for p5.js The idea behind the library is to give p5.js users a similar experience for those like me…

---

## [Cannot access my p5.js web editor account?!](https://discourse.processing.org/t/cannot-access-my-p5-js-web-editor-account/44355)

<div class="topic-metadata">

**Author:** [@megarou76](https://discourse.processing.org/u/megarou76)\
**Replies:** 2\
**Last updated:** [April 27, 2024, 2:50pm UTC](https://discourse.processing.org/t/cannot-access-my-p5-js-web-editor-account/44355 "2024-04-27T14:50:18Z")

</div>

Hello, well, something fishy & weird is going on with me?!!, although, I’m typing my correct password, but, still it is saying to me(invalid username/password)??!, I don’t know what wrong??!, what’s the matter exactly?!!…

---

## [Shaded polygons in P2D renderer?](https://discourse.processing.org/t/shaded-polygons-in-p2d-renderer/44335)

<div class="topic-metadata">

**Author:** [@grege2](https://discourse.processing.org/u/grege2)\
**Replies:** 5\
**Last updated:** [April 30, 2024, 9:09pm UTC](https://discourse.processing.org/t/shaded-polygons-in-p2d-renderer/44335 "2024-04-30T21:09:06Z")

</div>

Hi all, Dumb question coming, apologies … Can anyone confirm whether shaded polygons are possible in any way, under the P2D renderer ? I mean just the traditional Gouraud-shaded style, sim. to this example examples | p…

---

## [Editor.p5js.org server not available](https://discourse.processing.org/t/editor-p5js-org-server-not-available/44334)

<div class="topic-metadata">

**Author:** [@Laurent](https://discourse.processing.org/u/Laurent)\
**Replies:** 8\
**Last updated:** [April 26, 2024, 9:01am UTC](https://discourse.processing.org/t/editor-p5js-org-server-not-available/44334 "2024-04-26T09:01:52Z")

</div>

Hi everyone, Sorry if I’m repeating another recent published topic (that I’ve not found yet) but the online p5js editor (editor.p5js.org) is no more online. It’s actually what Cloudflare says. It seems the problem has b…

---

## [Using p5 variables and functions outside setup and draw](https://discourse.processing.org/t/using-p5-variables-and-functions-outside-setup-and-draw/44336)

<div class="topic-metadata">

**Author:** [@slacle](https://discourse.processing.org/u/slacle)\
**Replies:** 2\
**Last updated:** [April 24, 2024, 11:28am UTC](https://discourse.processing.org/t/using-p5-variables-and-functions-outside-setup-and-draw/44336 "2024-04-24T11:28:48Z")

</div>

Just making sure… p5 variables such as width and height, and p5 functions such as rect() and fill() can be used outside setup() and draw() as long as they’re in a function that is called from within either setup() or dr…

---

## [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…

---

## [Feature Request - Mouse button logic](https://discourse.processing.org/t/feature-request-mouse-button-logic/44325)

<div class="topic-metadata">

**Author:** [@Renatolo](https://discourse.processing.org/u/Renatolo)\
**Replies:** 1\
**Last updated:** [April 22, 2024, 11:49am UTC](https://discourse.processing.org/t/feature-request-mouse-button-logic/44325 "2024-04-22T11:49:50Z")

</div>

Hey, I recently fixed a bug related to the mouseButton (source/events/mouse.js) variable and im currently thinking about implementing a new feature where I further change the logic arround this variable (mantaining its c…

---

## [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: …

---

## [How can I delete unused assets ?](https://discourse.processing.org/t/how-can-i-delete-unused-assets/44288)

<div class="topic-metadata">

**Author:** [@slaine](https://discourse.processing.org/u/slaine)\
**Replies:** 2\
**Last updated:** [April 18, 2024, 12:05pm UTC](https://discourse.processing.org/t/how-can-i-delete-unused-assets/44288 "2024-04-18T12:05:30Z")

</div>

Hello, I’m Sylvie from France. I’m trying to use P5.js to create digital artworks. My knowledge of code is still basic but I’m learning. Here’s my problem: Yesterday, I created an account, and uploaded 78 PNG images fro…

---

## [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 …

[Previous page](https://discourse.processing.org/c/p5js/10.md?page=5)

[Next page](https://discourse.processing.org/c/p5js/10.md?page=7)
