p5.js
p5.js copied to clipboard
Solves issue #7059
Resolves https://github.com/processing/p5.js/issues/7059
Changes:
Here's a combined sketch that demonstrates the worldToScreen function in both 2D and WebGL contexts.
https://editor.p5js.org/Garima3110/sketches/ilpG7v9Cw
Screenshots of the change:
PR Checklist
- [x]
npm run lintpasses - [x] Inline documentation is included / updated
- [x] Unit tests are included / updated
Please review the code , whenever some maintainer finds the time, Also if you have any idea or some sort of a suggestion, for what example code should i add for the inline documentation of worldToScreen() it would be great!
Thankyou :-)
Thanks for taking this on, the code looks good!
- Do you think we can add a unit test for 2D and a unit test for 3D? Maybe both a simple case (e.g. no transforms have been applied) and also another that we can verify manually (like a 90 degree rotation)?
- For an example, maybe you could have something like a rotating square (or cube in 3D) where we draw the screen coordinates next to each vertex?
Thanks for taking this on, the code looks good!
- Do you think we can add a unit test for 2D and a unit test for 3D? Maybe both a simple case (e.g. no transforms have been applied) and also another that we can verify manually (like a 90 degree rotation)?
- For an example, maybe you could have something like a rotating square (or cube in 3D) where we draw the screen coordinates next to each vertex?
Yeah sure! @davepagurek
I'll try doing that by the end of this week.
Thankyou.
@davepagurek Just wanted to know , I tried npm run build command for building p5 and run some tests, but for dev2.0 branch the command doesn't work. Is there a different way to build p5 for dev2.0 branch, unlike the main branch which builds p5 just with npm run build.
@Garima3110 npm run build should work, what error did you get for it?
@Garima3110
npm run buildshould work, what error did you get for it?
Right I see, currently FES is still relying on the parameterData.json file for parameter validation but that file is dynamically generated by the 1.x build via grunt. @Garima3110 Can you switch back to the main branch, run the build, then switch to the dev-2.0 branch to try again? This should generate the parameterData.json file that can be packaged by the rollup build.
Actually just running npm run docs in the dev-2..0 branch will also generate the parameterData file as @davepagurek have set it up to run the generation script manually.
@davepagurek Do the tests seem fine ? Please have a look and let me know if some changes need to be made. Thankyou!!!
I have added more tests , and made some changes according to the suggestions please have a look!
Sorry for the delay on this! I recently got the tests passing on the dev-2.0 branch, so if you pull that branch in your fork and merge it into this branch again, we can double-check that we get a green checkmark from the test runner and then merge if it looks good.
While I continue troubleshooting the failed tests, I'm open to any suggestions you might have, @davepagurek!
Strange, all tests pass as I try this for the main branch but not here in the 2.0 branch.
Thanks for the clarification @davepagurek I’ll work on these suggestions and get back to you soon!
@davepagurek I have made some changes in the doc examples too, everything seems to work fine, please let me know if any other change needs to be done. Thankyou!