ScratchData LogoScratchData
Back to TheLogFather's profile

Pen shadows

THTheLogFather•Created July 3, 2016
Pen shadows
73
52
1530 views
View on Scratch

Description

An experiment to see if it's possible to render real-time shadows for sprites/clones. It arose after a bit of a challenge from @IcyCoder: https://scratch.mit.edu/users/DadOfMrLog/#comments-24742126 Each object should cast a shadow based on the relative position of the light source (the bulb). You can move the bulb using the arrow keys and you can drag the objects around the screen with the mouse. While dragging an object, use keys A & S to rotate it. It's really CPU intensive doing this, because of the MANY touching tests that Scratch has to do (for each 'ray' that is fired from the light, to every point around the edge of the screen). It's just about OK on my MacBook at coarse resolution 15ish, but it gets laggy pretty quickly below resolution 10. Anyone got any better ideas how to do it?

Project Details

Project ID115482733
CreatedJuly 3, 2016
Last ModifiedJuly 4, 2016
SharedJuly 4, 2016
Visibilityvisible
CommentsAllowed