# p5.js

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

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

**Page:** 64

---

## [Shading not working in v1.1.9 July 22, 2020](https://discourse.processing.org/t/shading-not-working-in-v1-1-9-july-22-2020/23142)

<div class="topic-metadata">

**Author:** [@CND](https://discourse.processing.org/u/CND)\
**Replies:** 2\
**Last updated:** [August 13, 2020, 6:48pm UTC](https://discourse.processing.org/t/shading-not-working-in-v1-1-9-july-22-2020/23142 "2020-08-13T18:48:25Z")

</div>

I just upgraded to p5js v1.1.9 July 22, 2020. I had shading before but now I don’t. settings: lights(); ambientLight(80,80,80); pointLight(0,0,0, 96,48,42); What do I need to change?

---

## [Is noise too much for mobile devices to handle in p5js?](https://discourse.processing.org/t/is-noise-too-much-for-mobile-devices-to-handle-in-p5js/23048)

<div class="topic-metadata">

**Author:** [@mnoble](https://discourse.processing.org/u/mnoble)\
**Replies:** 12\
**Last updated:** [August 13, 2020, 5:44pm UTC](https://discourse.processing.org/t/is-noise-too-much-for-mobile-devices-to-handle-in-p5js/23048 "2020-08-13T17:44:53Z")

</div>

Hello Forum :slight\_smile: I am working on a visualizer project for mobile devices and I found a great example of clouds using noise on Open Processing. It works good on laptops and crashes on mobile devices. Are noise …

---

## [Selecting from multiple cameras](https://discourse.processing.org/t/selecting-from-multiple-cameras/19679)

<div class="topic-metadata">

**Author:** [@carterjohnson](https://discourse.processing.org/u/carterjohnson)\
**Replies:** 5\
**Last updated:** [August 12, 2020, 8:54pm UTC](https://discourse.processing.org/t/selecting-from-multiple-cameras/19679 "2020-08-12T20:54:07Z")

</div>

Thanks in advance to anyone who might be able to help me out. I want to be able to make a selection as to which camera is utilized by its name or aspect ratio or some other property, and to do so with the code. I know t…

---

## [Cannot load image locally](https://discourse.processing.org/t/cannot-load-image-locally/23213)

<div class="topic-metadata">

**Author:** [@carterjohnson](https://discourse.processing.org/u/carterjohnson)\
**Replies:** 2\
**Last updated:** [August 12, 2020, 6:49pm UTC](https://discourse.processing.org/t/cannot-load-image-locally/23213 "2020-08-12T18:49:22Z")

</div>

This is very basic, I understand. My code below functions in the online editor, but it does not function locally in my own computer. I’ve tried downloading the p5.js file, as well as linking to it online, but to no avai…

---

## [Error with loadTable via drop](https://discourse.processing.org/t/error-with-loadtable-via-drop/23092)

<div class="topic-metadata">

**Author:** [@Tapestes](https://discourse.processing.org/u/Tapestes)\
**Replies:** 1\
**Last updated:** [August 12, 2020, 8:01am UTC](https://discourse.processing.org/t/error-with-loadtable-via-drop/23092 "2020-08-12T08:01:50Z")

</div>

In p5.js (v1.1.9, MacOS 10.15.6), I’m trying to load data into a table via the drop method. File appears to load fine, and when I log to the console I can see the file name and file contents no problem. The issue is loa…

---

## [shadowBlur on circles Particles](https://discourse.processing.org/t/shadowblur-on-circles-particles/23180)

<div class="topic-metadata">

**Author:** [@TienLe](https://discourse.processing.org/u/TienLe)\
**Replies:** 1\
**Last updated:** [August 12, 2020, 7:16am UTC](https://discourse.processing.org/t/shadowblur-on-circles-particles/23180 "2020-08-12T07:16:39Z")

</div>

I have some problems when using shadowBlur, I created particles just like this https://p5js.org/examples/simulate-particles.html But when I using this code to make a shadowBlur on circles, it’s very lag and bad performa…

---

## [P5js console scroll](https://discourse.processing.org/t/p5js-console-scroll/23168)

<div class="topic-metadata">

**Author:** [@Hapiel](https://discourse.processing.org/u/Hapiel)\
**Replies:** 1\
**Last updated:** [August 12, 2020, 6:36am UTC](https://discourse.processing.org/t/p5js-console-scroll/23168 "2020-08-12T06:36:51Z")

</div>

Hi guys, I’m excited to be a new member of the (so far) amazing processing community! Quick question: In the p5js web editor, is there a way to get the console to scroll down every time a new line is printed? When I wo…

---

## [P5.gui theme change](https://discourse.processing.org/t/p5-gui-theme-change/23161)

<div class="topic-metadata">

**Author:** [@SamuelCobb](https://discourse.processing.org/u/SamuelCobb)\
**Replies:** 1\
**Last updated:** [August 10, 2020, 9:21am UTC](https://discourse.processing.org/t/p5-gui-theme-change/23161 "2020-08-10T09:21:14Z")

</div>

Hey guys, I’ve been playing around with p5.gui to make one of my sims more user friendly. Although p5.gui is incredibly simple to use and I really love the ease of use. My problem is, it’s colour scheme isn’t exactly th…

---

## [Iterate unknown named object properties](https://discourse.processing.org/t/iterate-unknown-named-object-properties/23137)

<div class="topic-metadata">

**Author:** [@ZAF](https://discourse.processing.org/u/ZAF)\
**Replies:** 1\
**Last updated:** [August 9, 2020, 1:39am UTC](https://discourse.processing.org/t/iterate-unknown-named-object-properties/23137 "2020-08-09T01:39:34Z")

</div>

Hi, im working on a function called howMuchOn(users) wich recieves an object filled with objects as the following example shows: let users = { toni: { age: 33, online: true }, emily: { age: 25, online: true }, …

---

## [How to get screen coordinates for "Fit To Screen" function](https://discourse.processing.org/t/how-to-get-screen-coordinates-for-fit-to-screen-function/22514)

<div class="topic-metadata">

**Author:** [@CND](https://discourse.processing.org/u/CND)\
**Replies:** 16\
**Last updated:** [August 7, 2020, 7:29pm UTC](https://discourse.processing.org/t/how-to-get-screen-coordinates-for-fit-to-screen-function/22514 "2020-08-07T19:29:13Z")

</div>

I want to make a “Fit to Screen” function if it does not already exist. I need the screen coordinates to find the max width of the image compared to “width”. I found a mention of “frame.getInsets().left”. If this is what…

---

## [p5.Vector.mult issue](https://discourse.processing.org/t/p5-vector-mult-issue/23108)

<div class="topic-metadata">

**Author:** [@subhash](https://discourse.processing.org/u/subhash)\
**Replies:** 1\
**Last updated:** [August 7, 2020, 6:12pm UTC](https://discourse.processing.org/t/p5-vector-mult-issue/23108 "2020-08-07T18:12:39Z")

</div>

I am trying to multiply two vectors elementwise using p5.Vector.mult(). It shows some odd behavior. Could you tell me what am I doing wrong? My code: let v1 = createVector(-1,1,0); const rot\_axis = p5.Vector.m…

---

## [Workflow in p5js](https://discourse.processing.org/t/workflow-in-p5js/23076)

<div class="topic-metadata">

**Author:** [@Tahsin](https://discourse.processing.org/u/Tahsin)\
**Replies:** 2\
**Last updated:** [August 6, 2020, 5:34pm UTC](https://discourse.processing.org/t/workflow-in-p5js/23076 "2020-08-06T17:34:57Z")

</div>

Hey! So, I mostly code in processing java and py. But I wanna get started with javascript. I’ve tried the online p5 editor. But I couldn’t find a way to integrate it with github. I tried using localhost just like Dan s…

---

## [Having trouble with a simple drawing program in p5.js](https://discourse.processing.org/t/having-trouble-with-a-simple-drawing-program-in-p5-js/23074)

<div class="topic-metadata">

**Author:** [@alligatorpears](https://discourse.processing.org/u/alligatorpears)\
**Replies:** 5\
**Last updated:** [August 6, 2020, 4:01pm UTC](https://discourse.processing.org/t/having-trouble-with-a-simple-drawing-program-in-p5-js/23074 "2020-08-06T16:01:27Z")

</div>

Okay, so I am working on a very basic drawing program that so far has drawing, erasing, color picking, stroke weight, etc. However, I am now trying to make an eyedropper tool. How I want it to work is: You click on the e…

---

## [Porting MQTT MessageReceived function from Processing to p5](https://discourse.processing.org/t/porting-mqtt-messagereceived-function-from-processing-to-p5/22944)

<div class="topic-metadata">

**Author:** [@dantewong](https://discourse.processing.org/u/dantewong)\
**Replies:** 1\
**Last updated:** [August 5, 2020, 10:56pm UTC](https://discourse.processing.org/t/porting-mqtt-messagereceived-function-from-processing-to-p5/22944 "2020-08-05T22:56:42Z")

</div>

Hi. I’m very new to coding. I’m currently working on an MQTT project that involves an Arduino (Esp32) with sensors sending data (publishing) to an MQTT Broker and Processing picking up that data (subscribing)from the MQ…

---

## [I need move the players in board like Monopoly](https://discourse.processing.org/t/i-need-move-the-players-in-board-like-monopoly/23061)

<div class="topic-metadata">

**Author:** [@Xremix31](https://discourse.processing.org/u/Xremix31)\
**Replies:** 3\
**Last updated:** [August 5, 2020, 6:53pm UTC](https://discourse.processing.org/t/i-need-move-the-players-in-board-like-monopoly/23061 "2020-08-05T18:53:14Z")

</div>

Hi i need help for move players in board. I can show players but when move the player i can’t see this player. I use this code for set the player in tile. pl1.setTileCount(2) and i thin this move the player for other ti…

---

## [Drawing points on a circle](https://discourse.processing.org/t/drawing-points-on-a-circle/23046)

<div class="topic-metadata">

**Author:** [@thunderball](https://discourse.processing.org/u/thunderball)\
**Replies:** 2\
**Last updated:** [August 5, 2020, 1:18pm UTC](https://discourse.processing.org/t/drawing-points-on-a-circle/23046 "2020-08-05T13:18:24Z")

</div>

Hi, a bit of a silly question but I am rusty. I have a program that is drawing points around a circle but I want them to draw all at once (without removing the background) – what am I forgetting? let pts = 35; let a = …

---

## [Including P5js in a blog](https://discourse.processing.org/t/including-p5js-in-a-blog/22727)

<div class="topic-metadata">

**Author:** [@misterybodon](https://discourse.processing.org/u/misterybodon)\
**Replies:** 4\
**Last updated:** [August 4, 2020, 8:56pm UTC](https://discourse.processing.org/t/including-p5js-in-a-blog/22727 "2020-08-04T20:56:16Z")

</div>

Hello, I’m including some p5 sketches in a blogpost, but If I’m not mistaken the responsiveness will be an issue, because: we include the sketch through an iframe there is no way to make the canvas size resize nicely f…

---

## [Trying to display image (sprite) on mouseclick](https://discourse.processing.org/t/trying-to-display-image-sprite-on-mouseclick/23031)

<div class="topic-metadata">

**Author:** [@killimon](https://discourse.processing.org/u/killimon)\
**Replies:** 5\
**Last updated:** [August 4, 2020, 6:14pm UTC](https://discourse.processing.org/t/trying-to-display-image-sprite-on-mouseclick/23031 "2020-08-04T18:14:15Z")

</div>

Hi guys, I am new to p5.js and don’t know what I’m doing wrong. I am trying to display a sprite that I have created on a mouseclick. Unfortunately it doesn’t display. This also happens if use a basic image and not an ani…

---

## [p5.Vector returns strange and negative x and y values](https://discourse.processing.org/t/p5-vector-returns-strange-and-negative-x-and-y-values/23035)

<div class="topic-metadata">

**Author:** [@AbrarShahriar](https://discourse.processing.org/u/AbrarShahriar)\
**Replies:** 3\
**Last updated:** [August 4, 2020, 5:11pm UTC](https://discourse.processing.org/t/p5-vector-returns-strange-and-negative-x-and-y-values/23035 "2020-08-04T17:11:48Z")

</div>

please format code with \</\> button \* homework policy \* asking questions I was experimenting with one of Shiffman’s NOC examples. To be specific the steering behavior one. I added a target for my vehicle with the crea…

---

## [Element play method raised an error asynchronously](https://discourse.processing.org/t/element-play-method-raised-an-error-asynchronously/22955)

<div class="topic-metadata">

**Author:** [@Hepyrian](https://discourse.processing.org/u/Hepyrian)\
**Replies:** 1\
**Last updated:** [August 3, 2020, 6:34pm UTC](https://discourse.processing.org/t/element-play-method-raised-an-error-asynchronously/22955 "2020-08-03T18:34:47Z")

</div>

Hi everyone! I’m working on a larger sketch that needs to be able to play videos and control them with p5.touchgui elements. As you’ll see when you open my sketch, the video will only sometimes play, and a lot of the ti…

---

## [Image Circle Distortion in p5js](https://discourse.processing.org/t/image-circle-distortion-in-p5js/22993)

<div class="topic-metadata">

**Author:** [@leejdotjohnson](https://discourse.processing.org/u/leejdotjohnson)\
**Replies:** 3\
**Last updated:** [August 3, 2020, 5:42pm UTC](https://discourse.processing.org/t/image-circle-distortion-in-p5js/22993 "2020-08-03T17:42:12Z")

</div>

I am trying to implement a circle distortion function in p5js. Here is an example of what I want to achieve: Example In the example an original image is distorted into a 2d circle with an inner and outer radius. I hav…

---

## [Multiple canvas class](https://discourse.processing.org/t/multiple-canvas-class/20889)

<div class="topic-metadata">

**Author:** [@jimbrink](https://discourse.processing.org/u/jimbrink)\
**Replies:** 6\
**Last updated:** [August 3, 2020, 1:56am UTC](https://discourse.processing.org/t/multiple-canvas-class/20889 "2020-08-03T01:56:43Z")

</div>

I started using p5.js about half year ago. I wanted two canvases in the first major project I attempted was disappointed to read createCanvas should only be used once. Before learning there were already a couple of way…

---

## [Uncaught TypeError: velocity.reflect is not a function](https://discourse.processing.org/t/uncaught-typeerror-velocity-reflect-is-not-a-function/19402)

<div class="topic-metadata">

**Author:** [@mike\_ekim1024](https://discourse.processing.org/u/mike_ekim1024)\
**Replies:** 6\
**Last updated:** [August 2, 2020, 2:19am UTC](https://discourse.processing.org/t/uncaught-typeerror-velocity-reflect-is-not-a-function/19402 "2020-08-02T02:19:29Z")

</div>

The documentation clearly states there is a Vector.prototype.reflect() method, but does not exist on the object. https://p5js.org/reference/#/p5.Vector I did a console.log(p5.Vector.prototype) and it’s definitely not t…

---

## [Library creation help](https://discourse.processing.org/t/library-creation-help/22923)

<div class="topic-metadata">

**Author:** [@SamuelCobb](https://discourse.processing.org/u/SamuelCobb)\
**Replies:** 6\
**Last updated:** [August 1, 2020, 1:32pm UTC](https://discourse.processing.org/t/library-creation-help/22923 "2020-08-01T13:32:40Z")

</div>

Hey guys, So, I am not the most experienced p5 user but I am trying to write a “Picking” library for a specific project of mine. In the picking library, I need to create a “buffer” which is basically a hidden canvas whi…

---

## [ADAPTING ELEMENTS to DEVICES ORIENTATION CHANGE](https://discourse.processing.org/t/adapting-elements-to-devices-orientation-change/22877)

<div class="topic-metadata">

**Author:** [@akenaton](https://discourse.processing.org/u/akenaton)\
**Replies:** 0\
**Last updated:** [July 28, 2020, 3:25pm UTC](https://discourse.processing.org/t/adapting-elements-to-devices-orientation-change/22877 "2020-07-28T15:25:46Z")

</div>

in my sketch i create some elements (buttons) and give to them a position according to the windowWidth && windowHeight. As for desktop not any problems. As for phones or tablets it s more difficult but it is possible, kn…

---

## [My .obj failing to work with loadModel() - " Cannot read property 'vertices' of undefined"](https://discourse.processing.org/t/my-obj-failing-to-work-with-loadmodel-cannot-read-property-vertices-of-undefined/22909)

<div class="topic-metadata">

**Author:** [@TinkererDuty](https://discourse.processing.org/u/TinkererDuty)\
**Replies:** 0\
**Last updated:** [July 29, 2020, 3:07pm UTC](https://discourse.processing.org/t/my-obj-failing-to-work-with-loadmodel-cannot-read-property-vertices-of-undefined/22909 "2020-07-29T15:07:06Z")

</div>

Hi all, Apologies if this makes no sense as I’m fairly new to p5. I’m having trouble trying to get my .obj to work with loadModel() in my code. What I’m hoping is to allow the user to select an .obj of their choice an…

---

## [Multiple object intersection and removal](https://discourse.processing.org/t/multiple-object-intersection-and-removal/22900)

<div class="topic-metadata">

**Author:** [@AbrarShahriar](https://discourse.processing.org/u/AbrarShahriar)\
**Replies:** 2\
**Last updated:** [July 29, 2020, 2:38pm UTC](https://discourse.processing.org/t/multiple-object-intersection-and-removal/22900 "2020-07-29T14:38:40Z")

</div>

I am new to the discourse and not quite sure how to use it. But here I am. I am working on a ecosystem project, and I have an animal class with 2 different genders(0 for female, 1 for male). When 2 different genders int…

---

## [Surround video with opaque circle efficiently](https://discourse.processing.org/t/surround-video-with-opaque-circle-efficiently/22884)

<div class="topic-metadata">

**Author:** [@alphydan](https://discourse.processing.org/u/alphydan)\
**Replies:** 1\
**Last updated:** [July 28, 2020, 11:39pm UTC](https://discourse.processing.org/t/surround-video-with-opaque-circle-efficiently/22884 "2020-07-28T23:39:04Z")

</div>

I am trying to have the person in a video appear in the middle of a circle. Like so: Here’s my naive approach. Find the height of the person and the middle of the person with posenet: hPerson = dist(pose.nose.x, po…

---

## [Disabling Auto-Message to Users of a Sketch on OpenProcessing? Full Screen Issues](https://discourse.processing.org/t/disabling-auto-message-to-users-of-a-sketch-on-openprocessing-full-screen-issues/22740)

<div class="topic-metadata">

**Author:** [@mnoble](https://discourse.processing.org/u/mnoble)\
**Replies:** 8\
**Last updated:** [July 28, 2020, 3:47pm UTC](https://discourse.processing.org/t/disabling-auto-message-to-users-of-a-sketch-on-openprocessing-full-screen-issues/22740 "2020-07-28T15:47:34Z")

</div>

Hello Forum, I am working on a simple project with sounds and images for mobile devices on Open Processing. I love to present in their full screen mode. But, when I import sounds/media to my sketch and generate a url fo…

---

## [Alpha mask between objects](https://discourse.processing.org/t/alpha-mask-between-objects/22403)

<div class="topic-metadata">

**Author:** [@orgcaos](https://discourse.processing.org/u/orgcaos)\
**Replies:** 6\
**Last updated:** [July 27, 2020, 6:25pm UTC](https://discourse.processing.org/t/alpha-mask-between-objects/22403 "2020-07-27T18:25:49Z")

</div>

Hello guys! I hope you are safe :slight\_smile: I’m trying to hide a part of a shape I did using alpha mask but I have no idea how to achieve it. My current result looks like that: I want the black shape to act l…

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

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