==== From: Hopkins, Don [mailto:Hopkins, Don] Sent: Monday, February 15, 1999 2:20 PM To: snibbe@interval.com Cc: dhopkins@maxis.com Subject: Cellular Automata in AfterEffects! Hi, Scott! How's it going? I've just ported my cellular automata machine engine to AfterEffects as a plug-in! It's already making really cool movies, but I'm still trying to figure out how to create a useful interface to all its generality. If you're interested, I could send you a copy, in exchance for your feedback and advice! Essentially, it's an 8 bit process, so it can only apply to one channel at a time. But I came up with a cool, convenient way to map 8 bits to 32 bit rgba, to display the cellular automata in color! The trick is to use a 2-d image as an interpolatable array of colormaps! I made a 2-d "Colormap" layer argument and a "Colormap Phase" numeric argument. The colormap is defined by sampling a row of pixels, and the phase controls the y-coordinate of the row to sample. So you can draw a 2-d animated colormap, and cycle through it by changing the phase. I guess I might add a horizontal phase too, so you can also do traitional "colormap rotation". Or a temporal phase, so you can use movies as animated colormaps. An even more general approach to using an image as a colormap, would be to specify two (x,y) points to interpolate 256 samples between! I think I'm going to implement this technique, and use "colormap phase" to cycle that. Then you can just animate the endpoints of the line bouncing around in the 2-d colormap! I predict that pornographic images will work really well as 2-d animated colormap sources! Another feature I'm trying to implement is how to draw into the cellular automata while it's running. I have an "Overlay" layer argument, and an "Overlay Channel" argument, that composes the selected channel of the overlay, through its alpha channel, into the cells. So you can play one channel of a movie with an alpha channel into the cells! I need to add "Overlay Position" and "Overlay Transformation" arguments so you can move the overlay around, and use it like a paint brush. This will decouple the "drawing tool" problem so it can be address in a general way by another plug-in. Do you know if a plug-in exists that captures 2-d mouse gestures or pressure sensitive pen or joystick input over time, that I could use to animate points in AfterEffects? Or should I write that one, too? One big question is where do the cells live, and where does the initial configuration come from? Right now, the source image at time 0 defines the initial configuration and the size of the cell array. There's an argument to select which channel of the source image to use as the initial state. It recomputes the frame you want by starting with the source image, and applying the required number of rules, checking out the parameters over time, so you can animate all the arguments. The one optimization is that it remembers the last frame it did, so it can start with that if you're moving forward in time, and when it's rendering them in order, it only has to compute each frame once. The destination image is just a view of the cells, it does not check out the previous value of the source image in time. This is because all images in after effects are 32 bit, and my is optimized to only on 8 bit images. So it keeps the cells in its own front and back buffers, and renders them into the destination, via the colormap, or into one 8 bit channel. Another way you might want to use the plug-in would be to use the source image as the initial state each frame, sampled at the current time, and then run a certain number of rules on each frame. So instead of snapshotting the first frame and running one application of melt per frame on it again and again, you could take each frame and run one or more applications of melt on each one. Or even a sequence of several different rules, although it might be easier to just add another cellular automata plug-in for each rule you want to apply in sequence, than to make the user interface any more complicated. -Don ====