-
-
Notifications
You must be signed in to change notification settings - Fork 474
Misc WebGL Example Fixes #1282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Misc WebGL Example Fixes #1282
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c5d07a9
fixed issue where example graphic was positioned in the corner of the…
aceslowman 8a8fd3a
added ellipsoid to example. also added describe().
aceslowman 2a67e0b
added a spotLight to the example, added some text, and added describe()
aceslowman 8902783
Merge branch 'processing:main' into exampleFixes
aceslowman 9279c3f
Merge branch 'main' of https://github.com/processing/p5.js-website in…
aceslowman ca31777
Merge branch 'main' of https://github.com/processing/p5.js-website in…
aceslowman fe98b09
now accounting for displayDensity when defining shader uniform
aceslowman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,61 +1,74 @@ | ||
| /* | ||
| * @name Geometries | ||
| * @arialabel Six 3D shapes in neon gradient rotating on a white background. Shapes include cube, cylinder, ring, pyramid, sphere, and a plane. | ||
| * @description There are six 3D primitives in p5 now. | ||
| * @arialabel Seven 3D shapes in neon gradient rotating on a white background. Shapes include cube, cylinder, ring, pyramid, sphere, plane, and ellipsoid. | ||
| * @description There are seven 3D primitives in p5 now. | ||
| */ | ||
|
|
||
| function setup() { | ||
| createCanvas(710, 400, WEBGL); | ||
|
|
||
| describe( | ||
| 'a 3d example containing seven primitive objects, a plane, box, cylinder, cone, torus, sphere, and ellipsoid.' | ||
| ); | ||
| } | ||
|
|
||
| function draw() { | ||
| background(250); | ||
|
|
||
| translate(-240, -100, 0); | ||
| normalMaterial(); | ||
| push(); | ||
| translate(-240, -100, 0); | ||
| rotateZ(frameCount * 0.01); | ||
| rotateX(frameCount * 0.01); | ||
| rotateY(frameCount * 0.01); | ||
| plane(70); | ||
| pop(); | ||
|
|
||
| translate(240, 0, 0); | ||
| push(); | ||
| translate(0, -100, 0); | ||
| rotateZ(frameCount * 0.01); | ||
| rotateX(frameCount * 0.01); | ||
| rotateY(frameCount * 0.01); | ||
| box(70, 70, 70); | ||
| pop(); | ||
|
|
||
| translate(240, 0, 0); | ||
| push(); | ||
| translate(240, -100, 0); | ||
| rotateZ(frameCount * 0.01); | ||
| rotateX(frameCount * 0.01); | ||
| rotateY(frameCount * 0.01); | ||
| cylinder(70, 70); | ||
| pop(); | ||
|
|
||
| translate(-240 * 2, 200, 0); | ||
| push(); | ||
| translate(-250, 100, 0); | ||
| rotateZ(frameCount * 0.01); | ||
| rotateX(frameCount * 0.01); | ||
| rotateY(frameCount * 0.01); | ||
| cone(50, 70); | ||
| pop(); | ||
|
|
||
| push(); | ||
| translate(-75, 100, 0); | ||
| rotateZ(frameCount * 0.01); | ||
| rotateX(frameCount * 0.01); | ||
| rotateY(frameCount * 0.01); | ||
| cone(70, 70); | ||
| torus(50, 20); | ||
| pop(); | ||
|
|
||
| translate(240, 0, 0); | ||
| push(); | ||
| translate(100, 100, 0); | ||
| rotateZ(frameCount * 0.01); | ||
| rotateX(frameCount * 0.01); | ||
| rotateY(frameCount * 0.01); | ||
| torus(70, 20); | ||
| sphere(50); | ||
| pop(); | ||
|
|
||
| translate(240, 0, 0); | ||
| push(); | ||
| translate(275, 100, 0); | ||
| rotateZ(frameCount * 0.01); | ||
| rotateX(frameCount * 0.01); | ||
| rotateY(frameCount * 0.01); | ||
| sphere(70); | ||
| ellipsoid(30, 40, 40); | ||
| pop(); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aceslowman hmm, this doesn't appear in the center of the sketch for me. it's in the lower left quadrant. using just resolution (or the * 1.0) works. is that expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's strange! Just checked on my end, and it's displaying fine for me, in the middle of the screen. Also made sure that it was getting the updated uniforms.frag. Any clue why this might be different between our machines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, just caught some issue with line-endings, it wasn't loading for me until I changed the updated example files from CRLF to LF, otherwise I was getting 404s and the files weren't being properly assembled. I thought that the .gitattributes PR resolved this, not sure what is going on.