Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
124 views

I'm working in astro which uses vite as its bundler, don't know if that helps. So basically I have p5.js as a dependency for a sketch I demonstrate on my portfolio site, using the library from npm, ...
HyperChromatica's user avatar
1 vote
1 answer
75 views

When I use the createRadio() function from the p5js library in a function constructor and create multiple objects of that class, the radio buttons act differently, when I select an option in a radio ...
hamed rahafrouz's user avatar
-2 votes
1 answer
84 views

Whenever I try to deploy my p5play code on GitHub Pages, it just shows a blank screen. What can I do to resolve this issue? It works perfectly on VS Code. Specifically, the page has a white background....
Peanut's user avatar
  • 3
1 vote
0 answers
57 views

I have this piece of code: var framerate = 120; function setup() { createCanvas(1920, 1080); frameRate(framerate); } function draw() { clear(); textSize(13); text(frameRate(), 20, 20); } &...
Nproductions's user avatar
2 votes
1 answer
85 views

how do I fill the full canvas with the full webgl shader layer? The canvas is filling the full window width and height, but the webgl shader layer is stuck to the top right quadrant of the screen at ...
Emily Chu's user avatar
  • 209
1 vote
0 answers
45 views

I'm trying to create a smooth animation using differential line growth. I can have a snake on the screen grow and fill the space which I want. It's made up out of a number of nodes with two forces ...
spaciousmind's user avatar
3 votes
1 answer
83 views

I'm attempting to simulate wind blowing across plants on a p5js sketch and came across a lovely fragment shader that does pretty much what I want (// https://github.com/GameMakerDiscord/wind-shader ). ...
erik's user avatar
  • 3,862
0 votes
1 answer
54 views

I am trying to make a grid for a game, and I set up the grid, but when I use a for loop to display all of the cells it gives me an error - Uncaught TypeError: Cannot convert undefined or null to ...
CoderGuy's user avatar
0 votes
0 answers
32 views

I am using paged.js together with Kirby CMS and p5.js. And it is working pretty well. My Problem: I need to get informed when paged.js is finished rendering the page layout. There should be a hook for ...
Skaend's user avatar
  • 27
1 vote
1 answer
59 views

I am trying to make a program where there are two different screens that are centered on different players. I am using createGraphics() to try and achieve this. They render, but the screens aren't ...
CoderGuy's user avatar
0 votes
1 answer
110 views

I am trying to make a first-person player controller. I can make the camera pan/tilt on mouse movement, but I am having problems trying to make the player move in the direction the camera is facing. ...
CoderGuy's user avatar
1 vote
1 answer
79 views

I have created this program that checks the collisions of balls as they move in random directions. Each ball has life points, that decrease with each collision. I want my program to print out a ...
nouserbruh1's user avatar
1 vote
1 answer
69 views

I'm trying to make a third person player controller in p5js using WEBGL, and I can't figure out how to make the camera rotate around a point. I've tried using rotate, but it just makes the cube (...
CoderGuy's user avatar
2 votes
1 answer
62 views

I'm working on a class project to build a drawing app using p5.js. One of my features is a tool to draw different shapes and includes using a dropdown menu to select a shape to draw to the canvas. I'm ...
oodles's user avatar
  • 21
1 vote
1 answer
74 views

When using buildGeometry (in p5.js's webgl mode), the fill color can change inside the function while the stroke color cannot. Without this all shapes inside the function must have the same stroke ...
Jocowl's user avatar
  • 43
0 votes
1 answer
63 views

I’m trying to get p5.js to autoplay video on Firefox Android, but I haven’t found a solution yet. Here’s a CodePen link demonstrating the issue: https://codepen.io/vincent-vandercruyssen-kunstkaai/pen/...
Cearu's user avatar
  • 3
2 votes
2 answers
136 views

Working in p5.js on a class assignment. We have to make a music player. I found a tutorial in the site, but despite copying the code near-exactly (only altering so as to implement multiple songs), I ...
user29731287's user avatar
0 votes
0 answers
49 views

I'm learning about image processing in class and I need to be able to take a screenshot of the webcam video that I'm displaying to the screen currently using p5.js. The problem is when I click the ...
ejb1004's user avatar
  • 21
0 votes
0 answers
57 views

I'm working on a generative art project and seem to be running into an issue with the pixels function. Part of the artwork algorithm involves drawing circles (i.e., trees) in certain parts of the ...
Tom's user avatar
  • 11
1 vote
1 answer
111 views

I'm pretty new to coding, and I've been learning p5.js for a couple of weeks. I'm trying to write some code that will draw arcs of circles between evenly-spaced points on the top and right-hand edges ...
Pineapple Storage's user avatar
0 votes
1 answer
123 views

I'm using q5.js with p5play. I cannot find an easy way to detect a mouse click on a specific sprite. Whats the 'standard' way to do it in p5play?
user1768761's user avatar
0 votes
1 answer
56 views

I'm trying to implement a smudge effect on a texture using shaders and p5.js. I can see that the texture is being loaded into the shader and I can see the smudging, but my texture is flickering on ...
happycoder2121's user avatar
1 vote
0 answers
103 views

I am creating a pinball game for a school project. I am using p5.js for graphics and Matter.js for the physics. Everything else in my code is working except for the flippers, which keep firing ...
Lening Zhang's user avatar
0 votes
0 answers
58 views

I am simulating a snooker game via JavaScript using the P5 and Matter JS, I'm almost done but I'm having trouble with some of the ball behaviors. I added all the balls to the engine world in Matter JS ...
Ahmad Sekmani  's user avatar
0 votes
0 answers
38 views

Not showing p5,js sketches as Vercel gives an not defined error, in Vite works fine. Also would like to go to myproject/docs and show the jsdoc documentation. Load my project, and sketches are not ...
Eduardo Gutiérrez's user avatar
1 vote
0 answers
27 views

I'd like to be able to modify the vertex positions in a vertex shader BEFORE using phongmaterial. I can think of two solutions: apply a shader that modifies the coordinates before the phongShader ...
patrice pellier's user avatar
1 vote
1 answer
112 views

I'm new to P5.js and JavaScript programming in general, but I've taken a few lessons and am trying to make a few interesting images with what I know. However, I reached a few roadblocks while trying ...
Aidan A.'s user avatar
0 votes
0 answers
68 views

This is a prototype game about a goose who has to keep the temperature right or else the world ends. I'm trying to add in more mechanics in but I really can't move on because the lag gets worse the ...
Vabe Babe's user avatar
1 vote
2 answers
165 views

I am working with WebGL 3D objects within p5.js (JavaScript). I have four somewhat complicated "separate" 3D objects which, when working as planned, will be manipulated with a mouseOver ...
torchic's user avatar
  • 11
1 vote
0 answers
31 views

Adding function for hover and changing draw function I want to display the information of the datapoint when the mouse is hovered over the point. I tried adding a function and updated my draw function....
theamoghmerudi's user avatar
1 vote
1 answer
136 views

I'm trying to change the background behind the detected body segment, but I can't get it to work. Even though I'm modifying the background(...) function, it keeps defaulting to white. Can anyone ...
user27884943's user avatar
3 votes
0 answers
53 views

Note: I am not 100% sure if this question belongs here, as I dont know if the error is in the programming or in the math, please excuse me and direct me to where to post it Hi, I am trying to make an ...
Daniel Cruz's user avatar
  • 2,419
2 votes
2 answers
81 views

My p5.js sketch is freezing for a couple of frames every 2-3 seconds. I know p5 is not performant, but I feel like my sketch is optimized enough to not warrant this. I think it may have to do with how ...
Spencer Philips's user avatar
3 votes
1 answer
85 views

I have a very basic p5js script where I need to resize an image taken from the user via an input. I need to resize it by a percentage, so I need to know the original dimentions. For some reason, both ...
Daniel Cruz's user avatar
  • 2,419
1 vote
1 answer
88 views

Im working on a project were I need to draw some thick lines. I noticed that by default p5js lines are rounded at the ends. Is there a way to change this behavior? strokeWeight(50); line(150,150,300,...
Daniel Cruz's user avatar
  • 2,419
1 vote
0 answers
78 views

I’m trying to apply an invert clip to a shape, but, for this specific clip shape, the clip is not being applied to the shape. It works if the clip is not inverted, and it works with other clips, such ...
Pedro Gonçalves's user avatar
0 votes
1 answer
93 views

I have couple of states where I change on different parts of the project: which are: const [sketchDimensions, setSketchDimensions] = useState(SHOE_DIMENSIONS); const [selectedSegment, ...
mrconcerned's user avatar
  • 2,204
0 votes
1 answer
88 views

I am trying to make a drop down menu in p5js that displays images. I keep running into an error with loading images. When I attempted to troubleshoot and loaded an image in another sketch I did not ...
K-PopCorn's user avatar
2 votes
1 answer
81 views

I'm working with p5.js to explore color rendering by creating a dynamic color gradient using the point() function. However, I've noticed that when I use point() to draw colors, they appear lighter or ...
Faerity's user avatar
  • 21
0 votes
0 answers
44 views

I have built a game using React (and Matter JS and p5.js). It mainly has 2 variables, score (increments everytime goal is hit) and timer (decrements every second). I want music to play in the ...
Worker1432's user avatar
2 votes
1 answer
96 views

I've tried a bit of trig and playing with polar to cartesian coordinates but ultimately getting a bit lost on how to achieve an effect in JS. At the moment I've been using p5.js but open to other ...
Sophie Tooke's user avatar
2 votes
1 answer
452 views

I’m having issues understanding how the P5.js instance mode works. The syntax of creating the object seems so different from anything else I’ve seen. We’re instantiating a new object with the new p5(...
ny2cali's user avatar
  • 23
1 vote
0 answers
43 views

I know that if you have an opaque background, the previous frame appears. My goal is that the previous dots from previous frames will appear to give a streaking effect. However, setting the background ...
Shivam Singh's user avatar
0 votes
1 answer
76 views

I have followed the instructions of a "TheCodingTrain" tutorial, it describes how to calculate the distance between two circles to emulate collisions. I have a lot more, but this is the code ...
Oliver Riddle's user avatar
0 votes
1 answer
83 views

I have a game I'm making in p5.js, and I am having trouble rounding my health variable to the nearest one's place. I tried using p5.js's round() function, and it doesn't fit my problem. I don't think ...
Oliver Riddle's user avatar
1 vote
0 answers
85 views

Good afternoon all; Forgive me as I am very much a 'bodger' when it comes to coding so would appreciate your patience with my noviceness! I have made a rough sketch oppr.org/s/twgjO43M on ...
Alèn Martel's user avatar
0 votes
1 answer
54 views

Currently I'm working on a big project where I'm drawing the shoe model in canvas and using some functions to divide them into segments. Those segments are clickable in order to change the images ...
mrconcerned's user avatar
  • 2,204
0 votes
0 answers
62 views

I am trying to expand on The Coding Train's Monty Hall Problem demonstration using p5.js, and I am stuck in trying to implement an automatic mode. Everything works fine, except that the background of ...
Ardi's user avatar
  • 55
0 votes
1 answer
113 views

I'm writing a Perlin noise terrain generator with p5js, following this tutorial. The app ran poorly so I decided to rewrite it with shaders, something i've never used before. I started by generating a ...
SandWood Jones's user avatar
0 votes
2 answers
39 views

In p5, axis y points downwards. This code make it point upwads (and make the 0,0 the center) type gridRange={ xrange:{ min: number, max: number, }, yrange:{ min: ...
Pierre-olivier Gendraud's user avatar

1
2 3 4 5
64