Adjusted Paper.js gears example and updated paper.js. #2

Open
wants to merge 1 commit into
from

Projects

None yet

2 participants

@puckey
puckey commented Mar 3, 2012

I adjusted the Paper.js example to look more like the Raphael example - so the two can be compared. Right now they are based on two totally different code bases... the paper.js one seems overly complex..

@zgrossbart
Owner

Thanks so much for looking at the code and making the change. I wanted to use the latest stable version of Paper.js since this is a sample. Any idea when the next version will come out?

You're right that I could simplify the code, but the Paper and the Processing examples are both written to minimize the math you have to do ahead of time. The hope is that you can just add gears and the program will figure out where to put them and how fast to turn them.

The Raphael example is simpler because it came later and I got a little lazy. There's always a balance in samples between showing how to do something in the smallest amount of code possible and showing how to do it in a more maintainable way. What do you think?

Thanks,
Zack

@puckey
puckey commented Mar 4, 2012

Writing this kind of Gears code is def. a nice challenge, but I guess since the article is about comparing three different frameworks, you should really make sure the examples demonstrate the same thing. Currently it almost looks like Raphael is the easier of the three, just because it uses shortcuts in the code.. I can send another pull request with code that works with the latest stable release, if you want. Let me know.

@zgrossbart
Owner

I understand what you're saying about making one framework look easier than the other. It turned out that Paper was the easiest of the three. Making the gears work in Raphael was so difficult that I couldn't make it work without the author of the framework. The article makes all of that clear.

I think the right thing to do is keep your version and link to it from mine. That way people can see both. What do you think?

@puckey
puckey commented Mar 4, 2012

Sure, but your version also deserves a bit of care and love - there are quite a few simplifications to be done with vector geometry.. basically anywhere you find yourself using Math.sin / Math.cos can be simplified.. and a few other spots where you are working with point.x and point.y instead of directly working with the point itself.. Will try to find a moment to take a look at it soon

@zgrossbart
Owner

It's ironic you mention that. I did those because I was trying to make the Paper and Processing samples similar and Processing doesn't provide the awesome vector geometry and point objects that Paper does. You're right, I should clean those up. I'd love it if you had a pull request for those.

Thanks again for all the help. Paper is awesome and I'm using it in a large commercial product right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment