p5.js icon indicating copy to clipboard operation
p5.js copied to clipboard

Solves issue #7059

Open Garima3110 opened this issue 1 year ago • 14 comments

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

Garima3110 avatar Jul 05 '24 13:07 Garima3110

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 :-)

Garima3110 avatar Jul 05 '24 13:07 Garima3110

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?

davepagurek avatar Jul 11 '24 19:07 davepagurek

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.

Garima3110 avatar Jul 17 '24 04:07 Garima3110

@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 avatar Jul 20 '24 11:07 Garima3110

@Garima3110 npm run build should work, what error did you get for it?

limzykenneth avatar Jul 20 '24 12:07 limzykenneth

@Garima3110 npm run build should work, what error did you get for it?

image

Garima3110 avatar Jul 20 '24 12:07 Garima3110

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.

limzykenneth avatar Jul 21 '24 08:07 limzykenneth

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.

limzykenneth avatar Jul 26 '24 13:07 limzykenneth

@davepagurek Do the tests seem fine ? Please have a look and let me know if some changes need to be made. Thankyou!!!

Garima3110 avatar Aug 05 '24 12:08 Garima3110

I have added more tests , and made some changes according to the suggestions please have a look!

Garima3110 avatar Aug 06 '24 17:08 Garima3110

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.

davepagurek avatar Sep 14 '24 13:09 davepagurek

While I continue troubleshooting the failed tests, I'm open to any suggestions you might have, @davepagurek!

Garima3110 avatar Sep 14 '24 19:09 Garima3110

Strange, all tests pass as I try this for the main branch but not here in the 2.0 branch.

Garima3110 avatar Oct 17 '24 06:10 Garima3110

Thanks for the clarification @davepagurek I’ll work on these suggestions and get back to you soon!

Garima3110 avatar Oct 17 '24 19:10 Garima3110

@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!

Garima3110 avatar Oct 20 '24 19:10 Garima3110