We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi, I'm looking to convert a sketch I made in processing to p5.js. I have converted the processing code as best I could be still could not get it working.
Here's are my codes for the original pde and the converted one. http://pastebin.com/8EKhQ8dy (Original) http://pastebin.com/jq1XTDjj (Converted)
If anyone could lend a pair of eyes and glean what could make the sketch work I would be truly appreciative, thanks!
Answers
You'll have better luck if you just post your code in the post itself. Don't forget proper formatting.
Can you be more specific about what you're asking? What exactly does the sketch do? What exactly doesn't work about it? Are you getting any errors in the JavaScript console?
If you haven't read it yet, this article got lotsa useful tips to convert p5 to p5.js: O:-)
https://GitHub.com/processing/p5.js/wiki/Processing-transition
After a quick peek over your converted sketch, the 1st error I've spotted was the lack of
this.
before variables alphaDbl & alphaX. They're not declared anywhere either. So they belong to no class at all! :-SWhile in Java the use of
this.
is optional; in JS all members of a class gotta be prefixed w/ it when being accessed! L-)You also should consider using classes in JS too.
This way, the transition between those 2 languages are much easier: *-:)
https://developer.Mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes
anyone here willing to collaborate on a converter project?
https://daniloprates.github.io/p2p5/
(disclaimer: it's not converting yet)