Jens wrote:
no, it's not checking each pixel! Look more closely
I read somewhere around here that Scratch does bounding box collision, then if the 2 boxes collide, it checks each pixel.
Offline
Jens wrote:
no, it's not checking each pixel! Look more closely
Ah, I see it! source-in! That's brilliant, Jens. I would never have thought that.
Offline
I thought of using the same thing for JsScratch, but I didn't think it would be any better than just looping over the intersecting bounds and comparing the pixel transparency values.
I have to mention that color touching is a different story. You HAVE to loop over all the pixels in the costume every frame. If you find a better way to do this, let me know.
Last edited by MathWizz (2012-07-19 09:41:04)
Offline
Yes, I haven't found a better way to do color-collision, either. That's why I didn't yet implement it in Snap. We could make it more hue-tolerant and actually index those hues in every costume when it gets into the system (or changed). That way it would only take a little time once when you're editing the project, but afterwards it would be blazingly fast. Still undecided about this.
But, you know, I've implemented something else which covers many of those use-cases in which we'd otherwise have to check for color-collision: Pen trails collision. It's in today's update. I wonder if anyone found it yet
Offline
I have found it now.
Have you seen my 'fisheye' filter in JavaScript? I know, one of the more useless blocks in Scratch, but here it is: https://dl.dropbox.com/u/6274273/awesome.htm WebGL is faster than Scratch itself.
Last edited by MathWizz (2012-07-19 09:59:45)
Offline
MathWizz wrote:
Jens wrote:
Oh wow, that is fast and awesome, MathWizz! I love it, and might even steal it
I still have to polish things up though.
...
nothing happens for me (Safari 5.1)
Screenshot, please? I'm curious, now.
Offline
Hardmath123 wrote:
MathWizz wrote:
Jens wrote:
Oh wow, that is fast and awesome, MathWizz! I love it, and might even steal it
I still have to polish things up though.
...
nothing happens for me (Safari 5.1)
Screenshot, please? I'm curious, now.
Trade error log for image? :3
Offline
MathWizz wrote:
Hardmath123 wrote:
MathWizz wrote:
I still have to polish things up though.
...
nothing happens for me (Safari 5.1)
Screenshot, please? I'm curious, now.Trade error log for image? :3
Deal. Nothing in my error log.
EDIT: More helpfully, I know that the image has loaded (big astronomical smiley face, right?), that the window onload has been triggered, and WebGL is enabled.
Last edited by Hardmath123 (2012-07-19 10:38:32)
Offline
Hardmath123 wrote:
MathWizz wrote:
Hardmath123 wrote:
...
nothing happens for me (Safari 5.1)
Screenshot, please? I'm curious, now.Trade error log for image? :3
Deal. Nothing in my error log.
Dangit. xD
https://dl.dropbox.com/u/6274273/resour … MEFACE.png with a real-time fisheye effect.
Offline
... I meant with the fisheye effect...
Offline
Well I had the smiley already, how do you think I knew it was a smiley?
Oh, and I ran every possible Safari dev diagnostic I could find, nothing happened. I also used the console to manually refresh via window.onload(), and the (oversized) canvas blinked. So I'm guessing something to do with the image rendering is off. Lemme go read up on Safari's webgl support.
Last edited by Hardmath123 (2012-07-19 10:47:59)
Offline
Hardmath123 wrote:
Well I had the smiley already, how do you think I knew it was a smiley?
Oh, and I ran every possible Safari dev diagnostic I could find, nothing happened. I also used the console to manually refresh via window.onload(), and the (oversized) canvas blinked. So I'm guessing something to do with the image rendering is off. Lemme go read up on Safari's webgl support.
Wwwwaaaaiittt... I think it has to do with the animation. I had a similar problem recently...
http://stackoverflow.com/questions/1141 … ot-working
Offline
Lemme see... hang on.
Offline
Zilch.
Offline
Oh yes, and empty console. Can we stop cluttering the BYOB thread with this, BTW? Should we discuss on that other one you made?
Offline
bharvey wrote:
Hardmath123 wrote:
Debating whether or not to learn Python. 40% convinced
Not such a big decision! You already know all the semantics of the language; you just have to spend a weekend on the syntax.
See? Learn Python already!
Offline
We learned much at the Connecticut CSTA Workshop. I especially appreciated the attention to ways to help people learn CS Principles and pedagogy.
Collectively, we discovered and reported several bugs, e. g.:
http://byobugs.com/bugzilla/attachment.cgi?id=336
And they are generally fixed by the next day!
Thanks Brian, Jens, and the CCSTA for the opportunities.
Offline
scspaeth wrote:
Thanks Brian, Jens, and the CCSTA for the opportunities.
You're very welcome! It was great meeting you, and you found an incredible number of bugs!
@everyone else: He also figured out how to embed a Snap! project in a web page!
Offline