Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
81ff09d
updating computeFaces
perminder-17 Apr 15, 2025
77a1492
fixed vertexNormals
perminder-17 Apr 16, 2025
302e25b
vertices fixing
perminder-17 Apr 16, 2025
ade54ac
fixing
perminder-17 Apr 16, 2025
9df7595
fixing setAlpha
perminder-17 Apr 16, 2025
28cf83f
fixing-setGreen
perminder-17 Apr 16, 2025
5d2aad1
updating fontAscent
perminder-17 Apr 16, 2025
9e7445f
fixing @method pixels
perminder-17 Apr 16, 2025
12a6a17
fixing-getCurrentFrame()
perminder-17 Apr 16, 2025
8f017b0
fixing numFrames
perminder-17 Apr 16, 2025
eaedc0a
fixing setFrame()
perminder-17 Apr 16, 2025
2abbd76
fixing describe()
perminder-17 Apr 16, 2025
7b5d67c
fixing gridOutputs
perminder-17 Apr 16, 2025
c3851b3
fixing text-output
perminder-17 Apr 16, 2025
dac7ff2
fixing all p5.Camera text orientation
perminder-17 Apr 16, 2025
d19fefc
fixing setAttributes()
perminder-17 Apr 18, 2025
e4acb5f
fixing httpDo
perminder-17 Apr 18, 2025
9039796
fixing httpPost
perminder-17 Apr 18, 2025
63af24e
fixing print()
perminder-17 Apr 18, 2025
24763af
fixing getNum()
perminder-17 Apr 19, 2025
301d42f
Fixing rotationX(), rotationY() and rotationZ()
perminder-17 Apr 19, 2025
dd6a988
updating checkBox()
perminder-17 Apr 19, 2025
58e8746
createFileInput() orientation
perminder-17 Apr 19, 2025
25b164e
minor fixes
perminder-17 Apr 19, 2025
bf86b77
createElement fixes
perminder-17 Apr 19, 2025
289c176
fixing wording of setup() by removing preload
perminder-17 Apr 19, 2025
36b0bb0
fixing broken url
perminder-17 Apr 23, 2025
608d2fa
adding more context to docs
perminder-17 Apr 23, 2025
68dd3ae
reverting back to old p5.Geometry
perminder-17 Apr 23, 2025
cefb10b
Merge branch 'dev-2.0' into patch-9
perminder-17 Apr 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
updating computeFaces
  • Loading branch information
perminder-17 authored Apr 15, 2025
commit 81ff09d47f2015bc3db8b39392f6474e105a255e
21 changes: 14 additions & 7 deletions src/webgl/p5.Geometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -763,17 +763,15 @@ class Geometry {
*
* let myGeometry;
*
* let v0;
* let v1;
* let v2;
* let v3;
* function setup() {
* createCanvas(100, 100, WEBGL);
*
* // Create a p5.Geometry object.
* myGeometry = new p5.Geometry();
*
* // Create p5.Vector objects to position the vertices.
* let v0 = createVector(-40, 0, 0);
* let v1 = createVector(0, -40, 0);
* let v2 = createVector(0, 40, 0);
* let v3 = createVector(40, 0, 0);
* myGeometry = buildGeometry(createShape);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this usage of buildGeometry is a tad unusual currently -- typically the callback to buildGeoemtry draws a shape, but this one just assigns to some global variables, so this might end up confusing contributors.

I think the original pattern here using p5.Geometry is ok if we're doing fully custom vertices/faces. If we do buildGeometry, it could look something like this, without touching the vertices/faces afterwards:

myGeometry = buildGeometry(() => {
  beginShape(QUADS);
  vertex(-40, -40);
  vertex(40, -40);
  vertex(-40, 40);
  vertex(40, 40);
  endShape();
});

Copy link
Collaborator Author

@perminder-17 perminder-17 Apr 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I was initially exploring the documentation, I noticed that using the pattern new p5.Geometry() didn’t seem to work, nothing appeared on the canvas. Because of this, I assumed that we had moved entirely to using buildGeometry(). However, I recently came across examples on the latest beta site (https://beta.p5js.org/reference/p5.geometry/computefaces/), and to my surprise, they now work correctly. It seems that there may have been a recent fix or update that restored proper functionality to p5.Geometry, which is great to see. So, now I have reverted the code to old p5.Geoemtry. Hope that works?

*
* // Add the vertices to myGeometry's vertices array.
* myGeometry.vertices.push(v0, v1, v2, v3);
Expand All @@ -800,6 +798,15 @@ class Geometry {
* // Draw the p5.Geometry object.
* model(myGeometry);
* }
*
* function createShape() {
* // Create p5.Vector objects to position the vertices.
* v0 = createVector(-40, 0, 0);
* v1 = createVector(0, -40, 0);
* v2 = createVector(0, 40, 0);
* v3 = createVector(40, 0, 0);
* }
*
* </code>
* </div>
*
Expand Down