[INSTRUCTIONS: All objects are draggable, mouse over them and use arrow keys to rotate and resize. Press space for the editor. Editor instructions below.] My addition to the shadow rendering frenzy... Probably the fastest one yet! It only uses math, not the <touching> blocks, so everything is more efficient. Unfortunately, that means that it will get slower with more things on screen... However, for this demo, it's much faster, at least on my device. Because everything is done with math, there must be a geometric model for each costume. Don't worry, though, I made an editor so that you can quickly create your own! Try it out by pressing the space bar. [Please do try it out, I spent a lot of time (probably more than the actual shadow renderer) on it!] Editor instructions: By using circles and lines, create an outline of the image that can be used to detect edges. Be as efficient as possible to prevent lag! Circles count as one line each in terms of processing power, so use circles whenever possible. Dragging points and clicking buttons should be self-explanatory... You can also hold shift to delete multiple points or objects. The code is a bit messy right now (lots of reused variables), so don't hesitate to ask to have any scripts explained! A basic overview of what's going on: Models: The lists 'Models', 'Points', and 'Circles' hold all of the model data. 'Models' just points to locations within Points and Circles for each named model. Points is a series of (x,y) coordinates. Circles is a list of (x,y,r). These lines and circles are the only things that 'cast' a shadow. 'Get Lines': This one was a doozy. It simply converts all of the rotated, resized, repositioned models onto a coordinate plane relative to the light source. However, it uses a combination of polar and cartesian coordinates... A line of the form y=mx+b is formed through the two points. The m and b coefficients are stored in the list 'Lines' to be used when casting rays. What happens next (it actually happens first, but it doesn't really matter) is the special part. The endpoints of the lines aren't stored as coordinates, but instead are stored as angle relative to the light source. This way, when we cast rays, we can quickly tell whether or not we're going to hit the line. Circles: Circles are a little harder than lines, but they're actually stored the same way, in the 'Lines' list. Some geometry shows that you only need one line to simulate the effect of having a circle. Render: We point to every pixel on the edges of the screen (skipping a certain ratio for pen size). It's pretty easy to tell which lines we'll intersect at each direction, so then it's just a little more geometry to find the distance to the intersection. (I was very pleased at how small the resultant equation was). Editor: The editor isn't really complicated... Just bulky and hastily coded :/ ---------- Most of the lag right now comes from the first half of the Cast custom block. I've optimized it as much as I can, but it's still a very costly operation... If anyone finds potential improvements, don't hesitate to tell.