Skip to main content

All Questions

2 votes
1 answer
199 views

Fractal Tree in P5.js

I've been trying to create a simple fractal tree program using P5.js, for displaying on a website, but I seem to be getting unexpected behavior. Code and picture attached. function setup() { ...
Yonahel's user avatar
  • 23
0 votes
0 answers
198 views

Using saveGif with graphics object in p5.js?

I'm trying to save a series of images into a gif. I am trying to do this entirely in P5 without any other libraries or server side infrastructure. I got saveGif to work if I look at the main canvas, ...
calebhk98's user avatar
  • 306
1 vote
2 answers
99 views

Is it possible to optimize this code for maximum performance?

I programmed this type of Penrose Tilings in javascript and the algorithm is 'simple': The cyan pentagon always have to draw the yellow losangle and the grey pentagon almost always have to draw two ...
visionary's user avatar
1 vote
1 answer
59 views

3D Sphere isn't rendered properly

I programmed a 3d sphere in javascript using p5.js and isn't rendered properly. You can see a lack of color in the last meridian and all the sphere isn't colored in the right manner. I tried a lot of ...
visionary's user avatar
1 vote
1 answer
428 views

How do i access vertex coordinates of an obj model in p5.js?

I wanna be able to move around each individual vertex of an obj model that i imported into p5..so i wanna be able to access the coordinates of each individual vertex. Is this possible to do?? I tried ...
Nishchal Bhat's user avatar
1 vote
1 answer
140 views

I need help trying to synchronize the random playing of 4 music notes using MonoSynth with a graphical square on a canvas. Out of synch

I am randomly playing 4 notes, A4,B4,C4,D4 from an array using MonoSynth. I also have four coloured quadrants representing each note. Blue=A4, Yellow=B4, Red=C4, Green=D4. I am using a promise/await ...
AJJ's user avatar
  • 11
0 votes
1 answer
141 views

Looping an entire p5js script

I was wondering if it is possible to run the following code on the p5js web editor or within VS code multiple times and change the parameters a, b, A, B, H from an array of predefined values every ...
Michael's user avatar
  • 129
0 votes
1 answer
581 views

How to leave trail in my sketch without deleting the background in p5js?

I would like to leave line trails at each of the corners of the rectangles. I have tried createGraphics to add an extra canvas where I want to leave the trails but it's just doesn't work. I ...
Laszlo Papp's user avatar
0 votes
0 answers
235 views

Is there a way to have p5js run the same script multiple times but to read different input parameters each time? Is it possible to convert to an exe?

I was wondering if it is possible to convert a complex p5js project to an executable that would allow me to run it many thousands of times but with different input parameters? Alternatively, is it ...
Michael's user avatar
  • 129
0 votes
1 answer
285 views

Optimize rendering large of objects in p5js

I am trying to create a scene using p5.js that creates many different objects in 3d space. It works fine for a small number of objects but slows down really badly for thousands of objects. The ...
Michael's user avatar
  • 129
0 votes
1 answer
355 views

3D Object Faces Disappearing in p5.js

I am trying to make a 3D box with a pattern on each side using the following code but when viewed from certain angles, the back faces disappear when looking through the transparent parts of the ...
Michael's user avatar
  • 129
0 votes
2 answers
166 views

How to skip passing context again and again for html canvas while coding

I am trying to make something using html canvas but I have to pass context to each function again and again. Is there a way to skip or automate this task somehow? For example in p5.js we only have ...
Himanshu Jangid's user avatar
1 vote
0 answers
114 views

Dynamic Gridlines calculation

The problem Hello! I am creating a graphing application. Now I am creating the gridlines for the graphing calculator. To manage to zoom, I have two variables; scale_x for the X-axis, and scale_y for ...
Magnus Enebakk's user avatar
2 votes
2 answers
189 views

why does my a star algorithm not work in javascript?

function algorithm(){ if(startPoint === true && endPoint === true){ //add the heuristic distance to the start position from the final position startPosition.h = distance([startPosition.x, ...
Heidar-An's user avatar
  • 109
0 votes
1 answer
708 views

Setup p5.js in Electron

I am trying to use p5.js in a electron desktop app. I tried using templates from github but it didn't work I tried setting up my self it didn't work either. Here is my index.html code: <!DOCTYPE ...
Blank's user avatar
  • 51

15 30 50 per page