<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8133808492150620948</id><updated>2012-01-18T05:26:34.905-08:00</updated><category term='User Interface'/><category term='javascript'/><category term='Verlet Integration'/><category term='ray tracing'/><category term='html5'/><category term='books'/><category term='Emergence'/><category term='Voxel'/><category term='youtube'/><category term='flash games'/><category term='Particles'/><category term='Tutorials'/><category term='Photoshop'/><category term='Libraries'/><category term='adobe air'/><category term='C++'/><category term='interface'/><category term='audio'/><category term='Flash'/><category term='augmented reality'/><category term='css'/><category term='Cinema 4D'/><category term='Light'/><category term='Paint'/><category term='canvas'/><category term='Networks'/><category term='Animation'/><category term='facebook'/><category term='Julia Set'/><category term='xml'/><category term='save files'/><category term='jQuery'/><category term='Flash Catalyst'/><category term='pixel bender'/><category term='Physics'/><category term='fluid dynamics'/><category term='AS3'/><category term='webcam'/><category term='webdesign'/><category term='color detector'/><category term='music'/><category term='Optimisation'/><category term='image encoding'/><category term='Source Code'/><category term='anaglyph'/><category term='shape recognition'/><category term='CS5'/><category term='electronics'/><category term='Mandelbulb'/><category term='game design'/><category term='Classes'/><category term='Cellular Automata'/><category term='3D'/><category term='procedural generation'/><category term='Genetic Algorithms'/><category term='music visualizer'/><category term='Linux'/><category term='html'/><category term='mathematics'/><category term='raytracer'/><category term='face recognition'/><category term='fun'/><category term='Fractal'/><category term='itunes'/><category term='Mandelbrot'/><title type='text'>Experimentalized</title><subtitle type='html'>The home of experimental flash on the web!</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default?start-index=101&amp;max-results=100'/><author><name>Samuel Halliday</name><uri>http://www.blogger.com/profile/08255033729298666891</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_KzkDV0Nap-k/TS8VqTEHHkI/AAAAAAAAAAM/N2xrmWM-xEs/s1600-R/44601_423221441783_504126783_5546568_1386913_n.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>138</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-1083824121897606923</id><published>2012-01-12T08:51:00.001-08:00</published><updated>2012-01-12T08:54:18.647-08:00</updated><title type='text'>Recursive Random Triangular Subdivision</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: left;"&gt;
I've started getting into writing my blog on my lunch hour so I've had to come up with some quick and easy 30 minute experiments - I need the other 30 minutes to eat... Here is today's result (it follows along the lines of my &lt;a href="http://experimentalized.blogspot.com/2010/07/circle-packing-brute-force-approach.html"&gt;circle packing experiment&lt;/a&gt; a while back). It works like this. One starts by drawing a triangle, then picks a random point within that triangle. These vertices are then used to draw more triangles, and the process is repeated recursively. At each stage the triangles are rendered with a level of transparency. This means more "visited" triangles will appear brighter thus forming a kind of network. Click the image below to launch the demo and find the source &lt;a href="http://experimentalized.com/blog/sourcezip/Blog.zip"&gt;here&lt;/a&gt;.&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://experimentalized.com/blog/bin/triangles.swf?height=800&amp;amp;width=800" imageanchor="1" rel="prettyPhoto[flash]" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="556" src="http://2.bp.blogspot.com/-cfG-XQ4s5PU/Tw8N310oFPI/AAAAAAAAAGs/rv0cmCTguRI/s640/blog.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-1083824121897606923?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/1083824121897606923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2012/01/recursive-random-triangular-subdivision.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/1083824121897606923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/1083824121897606923'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2012/01/recursive-random-triangular-subdivision.html' title='Recursive Random Triangular Subdivision'/><author><name>Samuel Halliday</name><uri>http://www.blogger.com/profile/08255033729298666891</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_KzkDV0Nap-k/TS8VqTEHHkI/AAAAAAAAAAM/N2xrmWM-xEs/s1600-R/44601_423221441783_504126783_5546568_1386913_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-cfG-XQ4s5PU/Tw8N310oFPI/AAAAAAAAAGs/rv0cmCTguRI/s72-c/blog.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-3678503253017058714</id><published>2012-01-11T05:56:00.000-08:00</published><updated>2012-01-11T05:58:07.265-08:00</updated><title type='text'>Embedding Fonts In Actionscript 3</title><content type='html'>I hardly use the Flash IDE at all any more. Pretty much all of my coding is done in &lt;a href="http://www.flashdevelop.org/"&gt;FlashDevelop&lt;/a&gt;. One thing that the IDE does very well is the embedding of fonts but there are certainly ways of doing it using purely code. People seem to have found many ways of embedding fonts but this one has always worked for me:&lt;br /&gt;
&lt;br /&gt;
This class is my font library - I embed all fonts that I use in here. The two things to note are the embed code for the fonts and public constants to allow me to access them using FontLibrary.FONT...&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;textarea cols="75" rows="10"&gt;package org.experimentalized.fonts 
{
 /**
  * Font Library
  * @author Experimentalized
  */
 public class FontLibrary 
 {
  //Embed your fonts here
  [Embed(source="samplefont.ttf",fontName = "Mia's Scriblings ~", mimeType = "application/x-font-truetype")]
  private static const _samplefont:String;
  
  //Access font using this
  public static const FONT_SAMPLE:String = "Mia's Scriblings ~";
 }
}

&lt;/textarea&gt;
&lt;/pre&gt;
&lt;pre&gt;&lt;span style="font-family: 'Times New Roman'; white-space: normal;"&gt;This is the main class of my application. Here I create a sample text field and set the text format to one of my embedded fonts.&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;textarea cols="75" rows="10"&gt;package org.experimentalized.fonts 
{
 import flash.display.Sprite;
 import flash.text.TextField;
 import flash.text.TextFormat;
 
 public class Fonts_Demo extends Sprite 
 {  
  public function Fonts_Demo() 
  {
   //Create a new text field
   var text_field:TextField = new TextField();
   text_field.width = 500;
   text_field.height = 200;
   
   //Make sure we embed fonts
   text_field.embedFonts = true;
   
   //Create some text
   text_field.text = "This is a test";
      
   //Set the font using our new font library
   text_field.setTextFormat(new TextFormat(FontLibrary.FONT_SAMPLE, 30));
   
   //Add the text field to the display object list
   addChild(text_field);
  } 
 }
}
&lt;/textarea&gt;
&lt;/pre&gt;
&lt;pre&gt;&lt;span style="font-family: 'Times New Roman'; white-space: normal;"&gt;Easy!&amp;nbsp;You can download all of the source files for this and my other projects from:&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: 'Times New Roman';"&gt;&lt;span style="white-space: normal;"&gt;&lt;a href="http://experimentalized.com/blog/sourcezip/Blog.zip"&gt;http://experimentalized.com/blog/sourcezip/Blog.zip&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-3678503253017058714?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/3678503253017058714/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2012/01/embedding-fonts-in-actionscript-3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/3678503253017058714'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/3678503253017058714'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2012/01/embedding-fonts-in-actionscript-3.html' title='Embedding Fonts In Actionscript 3'/><author><name>Samuel Halliday</name><uri>http://www.blogger.com/profile/08255033729298666891</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_KzkDV0Nap-k/TS8VqTEHHkI/AAAAAAAAAAM/N2xrmWM-xEs/s1600-R/44601_423221441783_504126783_5546568_1386913_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-6125320805381390540</id><published>2012-01-11T05:24:00.000-08:00</published><updated>2012-01-11T05:28:54.681-08:00</updated><title type='text'>Two Dimensional Water Simulation</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: left;"&gt;
This is my first blog post in a while so I thought I'd try something interesting. A few years ago I took a look at some &lt;a href="http://experimentalized.blogspot.com/2010/03/3d-waves-projected-2d-fluid-simulation.html"&gt;discrete cell methods&lt;/a&gt; for simulating water in 2D. I decided to take a new approach and use a particle based method to simulate particles interacting. The image below shows the simulation running with 6000 particles at a reasonable framerate. All the particles in the scene repulse one another, and are accelerated earthward by gravity. If a&amp;nbsp;naive&amp;nbsp;approach were taken, the number of tests performed on each iteration of the program would be 6000 * 6000 = 3600000 distance calculations. This would be a large number of square roots for even the best CPU. In order to get around this I make use of some simple image filters to approximate the same result. Each particle is rendered to a bitmap buffer as a single pixel (I took this approach for a previous &lt;a href="http://experimentalized.blogspot.com/2010/05/attempt-at-fast-solution-to-n-body.html"&gt;experiment&lt;/a&gt;). These pixel values are then blurred and the gradients at each point on the bitmap calculated using&amp;nbsp;&lt;a href="http://experimentalized.blogspot.com/2010/09/real-time-regional-differencing_11.html"&gt;Sobel operators&lt;/a&gt;. At this stage calculating particles updated trajectories is just a case of subtracting the value of the gradient at each point from their velocity. Because the blur filter naturally falls off the repulsive force is proportional to the kernal used in the filtering process.&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
As usual just click to try out the demo!&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
The source code for all projects from now on will be added to a single flash project which can be found at:&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;a href="http://experimentalized.com/blog/sourcezip/Blog.zip"&gt;http://experimentalized.com/blog/sourcezip/Blog.zip&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://experimentalized.com/blog/bin/water_simulation.swf?height=400&amp;amp;width=550" imageanchor="1" rel="prettyPhoto[flash]" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-JFBYG0Kl90s/Tw2KhevCDtI/AAAAAAAAAGk/ODSe6oFxZiU/s1600/water_simulation.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-6125320805381390540?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/6125320805381390540/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2012/01/two-dimensional-water-simulation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6125320805381390540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6125320805381390540'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2012/01/two-dimensional-water-simulation.html' title='Two Dimensional Water Simulation'/><author><name>Samuel Halliday</name><uri>http://www.blogger.com/profile/08255033729298666891</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_KzkDV0Nap-k/TS8VqTEHHkI/AAAAAAAAAAM/N2xrmWM-xEs/s1600-R/44601_423221441783_504126783_5546568_1386913_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-JFBYG0Kl90s/Tw2KhevCDtI/AAAAAAAAAGk/ODSe6oFxZiU/s72-c/water_simulation.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-7157537133025640092</id><published>2011-08-08T13:55:00.000-07:00</published><updated>2011-08-08T13:57:29.964-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='music visualizer'/><category scheme='http://www.blogger.com/atom/ns#' term='audio'/><category scheme='http://www.blogger.com/atom/ns#' term='Source Code'/><title type='text'>Voice Recognition in Flash</title><content type='html'>This evening I thought I'd take a crack at looking at voice recognition in flash. The idea for this came after the realisation that when using my phone I have almost entirely given up on using the keypad. Instead I simply utter a few words (When passers by are out of ear shot) and a voice appears at the other end. Wonderful! I haven't read up on voice recognition at all so in part I am using the knowledge I've gained by looking at image recognition and tracking software. Being a big Aphex Twin fan and having written a spectrograph to visualize&amp;nbsp;&lt;a href="http://www.youtube.com/watch?v=u-KMFxzA_Lk"&gt;this song&lt;/a&gt; in flash before I had at least a bit of a grounding. The idea would be to record a small sample of voice, using some microphone thresholding, draw a spectograph of the sample and then compare the spectograph to a database of possible patterns and determine which command or whatever is most similar. I'm pleased to say that I have completed the first half of this today and you can click to see a demo below (The top image will launch it):&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a rel="prettyPhoto[flash]" href="http://experimentalized.com/experimentalized_blog/flsh/VRSoftware/MicrophoneEncoder.swf?height=320&amp;width=480" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="209" src="http://2.bp.blogspot.com/-Il9o50R7-OI/TkBLEeio1kI/AAAAAAAAAEI/ITXLxPEQ6QA/s320/whistle.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-LPtknfvHXyE/TkBLF2FktoI/AAAAAAAAAEM/nqbChRiBvzM/s1600/glass.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="211" src="http://2.bp.blogspot.com/-LPtknfvHXyE/TkBLF2FktoI/AAAAAAAAAEM/nqbChRiBvzM/s320/glass.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-TBPnCCw58SA/TkBLGZSRuEI/AAAAAAAAAEQ/dQpsqOvsXOc/s1600/hello.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="210" src="http://3.bp.blogspot.com/-TBPnCCw58SA/TkBLGZSRuEI/AAAAAAAAAEQ/dQpsqOvsXOc/s320/hello.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;The images are of a whistling sequence, a glass being rung, and me saying hello. Interestingly you can see the harmonics of the glass being rung (a few set frequencies). My voice is a bit harder to translate but using some analysis I'm sure it will be possible.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Anyway as usual the source code can be downloaded &lt;a href="http://experimentalized.com/experimentalized_blog/flsh/VRSoftware/Microphone%20Encoder.zip"&gt;here&lt;/a&gt; and let me know if you come up with anything using it. How about auto-tuning?!&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;The plan from here is to save single voice clips as images, and train a neural network to find patterns in both the volume and the spectograph for a set number of commands. I will report my findings shortly!&lt;/div&gt;&lt;br /&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-7157537133025640092?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/7157537133025640092/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2011/08/voice-recognition-in-flash.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/7157537133025640092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/7157537133025640092'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2011/08/voice-recognition-in-flash.html' title='Voice Recognition in Flash'/><author><name>Samuel Halliday</name><uri>http://www.blogger.com/profile/08255033729298666891</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_KzkDV0Nap-k/TS8VqTEHHkI/AAAAAAAAAAM/N2xrmWM-xEs/s1600-R/44601_423221441783_504126783_5546568_1386913_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-Il9o50R7-OI/TkBLEeio1kI/AAAAAAAAAEI/ITXLxPEQ6QA/s72-c/whistle.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-1485276634165461962</id><published>2011-07-16T15:42:00.000-07:00</published><updated>2011-07-16T15:45:58.155-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Libraries'/><category scheme='http://www.blogger.com/atom/ns#' term='Networks'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Source Code'/><category scheme='http://www.blogger.com/atom/ns#' term='Optimisation'/><title type='text'>Perceptron in Actionscript</title><content type='html'>I've always thought neural networks and the idea of computational learning was pretty cool but until now I'd never actually tried to program one. I decided to start out with something simple so I went for the single layer perceptron with the hope of building it up to something a bit smarter.&lt;br /&gt;
&lt;br /&gt;
For those of you who don't know much about neural networks Wikipedia has done a pretty decent job in teaching me everything I know. All the project files are available &lt;a href="http://www.experimentalized.com/experimentalized_blog/flsh/networks.zip"&gt;here&lt;/a&gt;&amp;nbsp;and sample source code is provided below. It is a simple solution to the NAND problem using two inputs.&lt;br /&gt;
&lt;br /&gt;
The perceptron class essentially has two functions, train and evaluate. The train function is called 100 times on the training set which adjusts the respective weights on each input. When evaluate is called on a particular inputs an output is produced. The output trace from the below program looks like this:&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #444444; font-size: x-small;"&gt;Initiating new perceptron:&lt;/span&gt;&lt;br /&gt;
&lt;div class="p1"&gt;&lt;span class="Apple-style-span" style="color: #444444; font-size: x-small;"&gt;Training 100 times using training set...&lt;/span&gt;&lt;/div&gt;&lt;div class="p1"&gt;&lt;span class="Apple-style-span" style="color: #444444; font-size: x-small;"&gt;Trained&lt;/span&gt;&lt;/div&gt;&lt;div class="p1"&gt;&lt;span class="Apple-style-span" style="color: #444444; font-size: x-small;"&gt;Evaluating NAND[0,0] : 1&lt;/span&gt;&lt;/div&gt;&lt;div class="p1"&gt;&lt;span class="Apple-style-span" style="color: #444444; font-size: x-small;"&gt;Evaluating NAND[1,0] : 1&lt;/span&gt;&lt;/div&gt;&lt;div class="p1"&gt;&lt;span class="Apple-style-span" style="color: #444444; font-size: x-small;"&gt;Evaluating NAND[0,1] : 1&lt;/span&gt;&lt;/div&gt;&lt;div class="p1"&gt;&lt;span class="Apple-style-span" style="color: #444444; font-size: x-small;"&gt;Evaluating NAND[1,1] : 0&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
This is a fast solution to these kinds of problems. I plan on implementing optimisations such as exiting training when the weights change by less than some threshold (i.e the solution limit has been reached), but the end goal is to produce a full library with many kinds of next step. I think the next of these will be a multilayer perceptron which initial research suggests is much more complicated! Enjoy the classes and let me know if you do anything interesting with them.&lt;br /&gt;
&lt;title&gt;&lt;/title&gt;   &lt;style type="text/css"&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #aa0dd6}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; min-height: 15.0px}
p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #14a800}
p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #a5100f}
span.s1 {color: #3c41ff}
span.s2 {color: #aa0dd6}
span.s3 {color: #49a978}
span.s4 {color: #000000}
span.s5 {color: #d17b7b}
span.s6 {color: #80a9d5}
span.s7 {color: #a5100f}
span.Apple-tab-span {white-space:pre}
&lt;/style&gt;   &lt;br /&gt;
&lt;div class="p1"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;package&lt;/span&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s1"&gt;import&lt;/span&gt; flash.display.Sprite;&lt;/span&gt;&lt;/div&gt;&lt;div class="p3"&gt;&lt;span class="Apple-tab-span"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;	&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s1"&gt;import&lt;/span&gt; org.experimentalized.networks.SingleLayerPerceptron;&lt;/span&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s1"&gt;import&lt;/span&gt; org.experimentalized.networks.objects.Trainer;&lt;/span&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s1"&gt;import&lt;/span&gt; org.experimentalized.networks.objects.TrainerSet;&lt;/span&gt;&lt;/div&gt;&lt;div class="p3"&gt;&lt;span class="Apple-tab-span"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;	&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s1"&gt;public&lt;/span&gt; &lt;span class="s2"&gt;class&lt;/span&gt; Main &lt;span class="s1"&gt;extends&lt;/span&gt; Sprite&lt;/span&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s1"&gt;public&lt;/span&gt; &lt;span class="s3"&gt;function&lt;/span&gt; Main()&lt;/span&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div class="p4"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="s4"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;//NAND example&lt;/span&gt;&lt;/div&gt;&lt;div class="p3"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="p5"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="s4"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;&lt;span class="s5"&gt;trace&lt;/span&gt;&lt;span class="s4"&gt;(&lt;/span&gt;"Initiating new perceptron:"&lt;span class="s4"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="p3"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s6"&gt;var&lt;/span&gt; perceptron:SingleLayerPerceptron = &lt;span class="s1"&gt;new&lt;/span&gt; SingleLayerPerceptron(0.1);&lt;/span&gt;&lt;/div&gt;&lt;div class="p3"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s6"&gt;var&lt;/span&gt; training_set:TrainerSet = &lt;span class="s1"&gt;new&lt;/span&gt; TrainerSet([&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s1"&gt;new&lt;/span&gt; Trainer([0,0],1),&lt;/span&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s1"&gt;new&lt;/span&gt; Trainer([1,0],1),&lt;/span&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s1"&gt;new&lt;/span&gt; Trainer([0,1],1),&lt;/span&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s1"&gt;new&lt;/span&gt; Trainer([1,1],0)&lt;/span&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;]);&lt;/span&gt;&lt;/div&gt;&lt;div class="p3"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="p5"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="s4"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;&lt;span class="s5"&gt;trace&lt;/span&gt;&lt;span class="s4"&gt;(&lt;/span&gt;"Training 100 times using training set..."&lt;span class="s4"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="p3"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;perceptron.TrainSet(training_set,100);&lt;/span&gt;&lt;/div&gt;&lt;div class="p3"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s5"&gt;trace&lt;/span&gt;(&lt;span class="s7"&gt;"Trained"&lt;/span&gt;);&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="p3"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="p4"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="s4"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;/span&gt;//Test some evaluations&lt;/span&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s5"&gt;trace&lt;/span&gt;(&lt;span class="s7"&gt;"Evaluating NAND[0,0] :"&lt;/span&gt;,perceptron.Evaluate([1,0]));&lt;/span&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s5"&gt;trace&lt;/span&gt;(&lt;span class="s7"&gt;"Evaluating NAND[1,0] :"&lt;/span&gt;,perceptron.Evaluate([1,0]));&lt;/span&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s5"&gt;trace&lt;/span&gt;(&lt;span class="s7"&gt;"Evaluating NAND[0,1] :"&lt;/span&gt;,perceptron.Evaluate([0,1]));&lt;/span&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="s5"&gt;trace&lt;/span&gt;(&lt;span class="s7"&gt;"Evaluating NAND[1,1] :"&lt;/span&gt;,perceptron.Evaluate([1,1]));&lt;/span&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-tab-span"&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="p2"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-1485276634165461962?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/1485276634165461962/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2011/07/perceptron-in-actionscript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/1485276634165461962'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/1485276634165461962'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2011/07/perceptron-in-actionscript.html' title='Perceptron in Actionscript'/><author><name>Samuel Halliday</name><uri>http://www.blogger.com/profile/08255033729298666891</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_KzkDV0Nap-k/TS8VqTEHHkI/AAAAAAAAAAM/N2xrmWM-xEs/s1600-R/44601_423221441783_504126783_5546568_1386913_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-1184387927862928288</id><published>2011-07-07T10:47:00.000-07:00</published><updated>2011-07-07T10:58:17.731-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Source Code'/><category scheme='http://www.blogger.com/atom/ns#' term='Classes'/><title type='text'>Colour Wheel - HSV Colour Space</title><content type='html'>I've just been playing around with colour wheels and colour representation in flash. I had a think about whether it was possible to represent every single colour in the RGB spectrum on a single 2D image. Closer inspection reveals that it isn't possible because RGB is made up of three components - red, green and blue - and therefore needs three dimensions. This is why if you look up different colour representations on Wikipedia you might see them represented by cones, or cubes. I decided to work in the HSV colour space which is &amp;nbsp;formed of Hue (rotation), Saturation (The amount of colour compared to black/white) and Value (Essentially the brightness). The resulting colour wheel can be seen below:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a rel="prettyPhoto[flash]" href="http://experimentalized.com/experimentalized_blog/flsh/ColourWheel.swf?height=450&amp;amp;width=600" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-ihEaGLiqNvA/ThXwXl0bWUI/AAAAAAAAADU/vC5s1jfvWi4/s320/Screen.png" width="318" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Just click on the image to launch the app. By rolling over the wheel the colour in the box will show the selected colour. Use the up/down arrow keys to alter the "V" value of the wheel. This should allow you to view a complete (discrete) representation of every colour in the RGB spectrum.&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;If you're interested in source code just click &lt;a href="http://experimentalized.com/experimentalized_blog/flsh/ColourWheel.zip"&gt;here&lt;/a&gt; to download the FlashBuilder project and AS files. Enjoy!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-1184387927862928288?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/1184387927862928288/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2011/07/colour-wheel-hsv-colour-space.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/1184387927862928288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/1184387927862928288'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2011/07/colour-wheel-hsv-colour-space.html' title='Colour Wheel - HSV Colour Space'/><author><name>Samuel Halliday</name><uri>http://www.blogger.com/profile/08255033729298666891</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_KzkDV0Nap-k/TS8VqTEHHkI/AAAAAAAAAAM/N2xrmWM-xEs/s1600-R/44601_423221441783_504126783_5546568_1386913_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-ihEaGLiqNvA/ThXwXl0bWUI/AAAAAAAAADU/vC5s1jfvWi4/s72-c/Screen.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-2091936991768775015</id><published>2011-06-28T13:20:00.000-07:00</published><updated>2011-07-08T10:36:55.333-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Source Code'/><title type='text'>There's nothing boring about Tax!</title><content type='html'>Well the title might be a bit&amp;nbsp;misleading, but I'll let you be the judge of that. A close friend and I were in the pub last week discussing the benefits of a tax system which, instead of being tiered, would be characterised by a continuous curve. My friend being an Economist, and me a Physicist, and both of us slightly tipsy thought that we might be able to change the world with our new theory - so I went home that night and wrote a small program using &lt;a href="http://experimentalized.blogspot.com/2010/08/flashmath-demo-1.html"&gt;FlashMath&lt;/a&gt;&amp;nbsp;to try and quantify some of our ideas. The program essentially integrated over a Cauchy-Schwartz curve and compared collected tax with that of the standard tiered&amp;nbsp;system. I had planned on expanding on this by optimising the curve using measures such as utility (an economic measure of&amp;nbsp;happiness&amp;nbsp;of a population) but for now here is the source code:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;textarea cols="90" rows="10"&gt;package org.experimentalized
{
 package
{
 import flash.display.MovieClip;
 import com.experimentalized.math.quadrature.SimpsonsQuadrature;

 public class Tax extends MovieClip
 {
  private var gamma:Number = 7000;
  private var x0:Number = 22000;
  private var population:Number = 65000000;
  
  private var gamma2:Number = 12000;
  private var x1:Number = 30000;
  private var beta:Number = 0.52;
  
  public function Tax()
  {   
   trace(calculate_total_teired_tax_collected(1000000));
   trace(calculate_total_new_tax_collected(1000000));
  }
  
  public function calculate_total_new_tax_collected(Limit:Number):Number
  {
   var S:SimpsonsQuadrature = new SimpsonsQuadrature(new_tax_proportion,0,Limit,100);
   return S.integrate();
  }
  
  public function new_tax_proportion(X:Number):Number
  {
   return population*calculate_new_tax_collected(X)*evaluate_income_percentile(X);
  }
  
  public function calculate_new_tax_collected(income:Number):Number
  {
   var S:SimpsonsQuadrature = new SimpsonsQuadrature(lorenzian_cdf,0,income+0.001,100);
   return S.integrate();
  }
  
  public function lorenzian_cdf(X:Number):Number
  {
   return (1/Math.PI)*Math.atan((X-x1)/gamma2)*beta + beta/2;
  }
  
  public function calculate_total_teired_tax_collected(Limit:Number):Number
  {
   var S:SimpsonsQuadrature = new SimpsonsQuadrature(teired_tax_proportion,0,Limit,100);
   return S.integrate();
  }
   
  public function teired_tax_proportion(X:Number):Number
  {
   return population*calculate_teired_tax_collected(X)*evaluate_income_percentile(X);
  }
  
  public function calculate_teired_tax_collected(income:Number):Number
  {
   var taxable:Number = income - 7475;
   if(income&amp;gt;100000) taxable = income;
   
   var basic_rate:Number = taxable;
   if(basic_rate&amp;gt;35000) basic_rate = 35000;
   
   taxable = taxable - basic_rate;
   
   var higher_rate:Number = taxable;
   if(higher_rate&amp;gt;115000) higher_rate = 115000;
   
   taxable = taxable - higher_rate;
   
   var additional_rate:Number = taxable;   
   
   if(basic_rate&amp;lt;0) basic_rate = 0;
   if(higher_rate&amp;lt;0) higher_rate = 0;
   if(additional_rate&amp;lt;0) additional_rate = 0;
   
   return basic_rate * 0.2 + higher_rate * 0.4 + additional_rate * 0.5;
  }
    
  public function evaluate_income_percentile(X:Number):Number
  {
   //Model as lorenzian
   return (1/Math.PI)*(gamma/((X-x0)*(X-x0) + gamma*gamma))   
  }
 }
}
&lt;/textarea&gt;
&lt;/pre&gt;&lt;br /&gt;
It isn't commented in the slightest but see what you can make out of it!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-2091936991768775015?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/2091936991768775015/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2011/06/theres-nothing-boring-about-tax.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/2091936991768775015'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/2091936991768775015'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2011/06/theres-nothing-boring-about-tax.html' title='There&apos;s nothing boring about Tax!'/><author><name>Samuel Halliday</name><uri>http://www.blogger.com/profile/08255033729298666891</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_KzkDV0Nap-k/TS8VqTEHHkI/AAAAAAAAAAM/N2xrmWM-xEs/s1600-R/44601_423221441783_504126783_5546568_1386913_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-3704776099049732235</id><published>2011-05-04T11:57:00.000-07:00</published><updated>2011-05-04T11:57:29.159-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Animation'/><category scheme='http://www.blogger.com/atom/ns#' term='youtube'/><title type='text'>iPhone Location Data</title><content type='html'>For those of you who haven't yet heard, Apple are tracking your every move. As somebody who has nothing to hide ( hopefully ), I thought I'd share an experiment I'd carried out using some of my own location data and &lt;a href="http://www.openheatmap.com/"&gt;OpenHeatMap&lt;/a&gt;. Apple store triangulated data based on nearby cell masts and not based on GPS which is a slight shame because the accuracy isn't great. Here is a greatly speeded up video of my actions since December 2010.&lt;br /&gt;
&lt;br /&gt;
&lt;object style="height: 390px; width: 640px;"&gt;&lt;param name="movie" value="http://www.youtube.com/v/Lpx2wYbLBtw?version=3"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/Lpx2wYbLBtw?version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="390"&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-3704776099049732235?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/3704776099049732235/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2011/05/iphone-location-data.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/3704776099049732235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/3704776099049732235'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2011/05/iphone-location-data.html' title='iPhone Location Data'/><author><name>Samuel Halliday</name><uri>http://www.blogger.com/profile/08255033729298666891</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_KzkDV0Nap-k/TS8VqTEHHkI/AAAAAAAAAAM/N2xrmWM-xEs/s1600-R/44601_423221441783_504126783_5546568_1386913_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-4092726558079235510</id><published>2011-04-25T09:04:00.000-07:00</published><updated>2011-04-25T09:04:43.953-07:00</updated><title type='text'>Aerodynamics for Convex Hulls</title><content type='html'>I had quite a nice thought experiment and thought I'd document it for you guys to have a look at. I wanted to come up with a quick way to (semi) realistically simulate lift and drag on any shape. Such an engine could be used for flash games for example a hang glider game. Realism like this (if carefully implemented) can add a lot to a game.&lt;br /&gt;
&lt;br /&gt;
I plan on implementing this in flash sometime after my exams are over, but some of you might be interested in my approach, so feel free to beat me to coding it!&lt;br /&gt;
&lt;br /&gt;
Here is what I've got so far, you can click on a page to expand it in a lightbox (or click &lt;a href="http://experimentalized.com/experimentalized_blog/flsh/Equations.pdf"&gt;here&lt;/a&gt; to download the pdf):&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a rel="prettyPhoto" href="http://3.bp.blogspot.com/-KpiiE5s-JDk/TbWbE5FDX5I/AAAAAAAAADA/01tPBlUwQuA/s1600/Equations-0.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="640" src="http://3.bp.blogspot.com/-KpiiE5s-JDk/TbWbE5FDX5I/AAAAAAAAADA/01tPBlUwQuA/s640/Equations-0.jpg" width="494" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a rel="prettyPhoto" href="http://2.bp.blogspot.com/-VJZG6sT7C-U/TbWbF-PW-SI/AAAAAAAAADE/SnMZIzW2DAw/s1600/Equations-1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="640" src="http://2.bp.blogspot.com/-VJZG6sT7C-U/TbWbF-PW-SI/AAAAAAAAADE/SnMZIzW2DAw/s640/Equations-1.jpg" width="494" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-4092726558079235510?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/4092726558079235510/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2011/04/aerodynamics-for-convex-hulls.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/4092726558079235510'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/4092726558079235510'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2011/04/aerodynamics-for-convex-hulls.html' title='Aerodynamics for Convex Hulls'/><author><name>Samuel Halliday</name><uri>http://www.blogger.com/profile/08255033729298666891</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_KzkDV0Nap-k/TS8VqTEHHkI/AAAAAAAAAAM/N2xrmWM-xEs/s1600-R/44601_423221441783_504126783_5546568_1386913_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-KpiiE5s-JDk/TbWbE5FDX5I/AAAAAAAAADA/01tPBlUwQuA/s72-c/Equations-0.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-7115937976363158918</id><published>2011-04-25T06:50:00.000-07:00</published><updated>2011-07-08T10:51:14.536-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Source Code'/><title type='text'>Fun with Inverse Kinematics</title><content type='html'>&lt;div class="" style="clear: both; text-align: left;"&gt;In part to try out AXDT, a flash plugin for Eclipse (which you can find &lt;a href="http://axdt.org/wiki/Installation"&gt;here&lt;/a&gt;), I decided to create a simple experiment involving Inverse Kinematics. This is not a very useful implementation but the results are quite fun. Essentially, the angles of subsections of &amp;nbsp;each kinematic chain are altered until they face the mouse. I quickly discovered this is not the best solution for IK, but just for fun I made a kind of windswept, fur or grass effect using about 200 IK chains.&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;As usual click the top screenshot to launch the experiment and click &lt;a href="http://experimentalized.com/experimentalized_blog/flsh/IK.zip"&gt;here&lt;/a&gt; for source:&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/RotationalInverseKinematics1.swf?height=400&amp;amp;width=550" imageanchor="1" rel="prettyPhoto[flash]" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="229" src="http://2.bp.blogspot.com/-t8z57bNL0jQ/TbVxAbItC3I/AAAAAAAAAC8/cQa6iGWoikI/s320/Screenshot-1.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-w4O4cpMj00E/TbVvroPK5nI/AAAAAAAAAC4/k2dhpwjgX_E/s1600/Screenshot.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="228" src="http://4.bp.blogspot.com/-w4O4cpMj00E/TbVvroPK5nI/AAAAAAAAAC4/k2dhpwjgX_E/s320/Screenshot.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-7115937976363158918?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/7115937976363158918/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2011/04/fun-with-inverse-kinematics.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/7115937976363158918'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/7115937976363158918'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2011/04/fun-with-inverse-kinematics.html' title='Fun with Inverse Kinematics'/><author><name>Samuel Halliday</name><uri>http://www.blogger.com/profile/08255033729298666891</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_KzkDV0Nap-k/TS8VqTEHHkI/AAAAAAAAAAM/N2xrmWM-xEs/s1600-R/44601_423221441783_504126783_5546568_1386913_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-t8z57bNL0jQ/TbVxAbItC3I/AAAAAAAAAC8/cQa6iGWoikI/s72-c/Screenshot-1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-2005874021953778413</id><published>2011-04-20T00:40:00.001-07:00</published><updated>2011-04-20T01:25:22.696-07:00</updated><title type='text'>New Source Code Page</title><content type='html'>Hey guys,&lt;br /&gt;
&lt;br /&gt;
Due to many requests being for source code I have added a source section to the blog. When my exams are over I'll work through adding source code to older projects but for now I've included a few from some new stuff I've been working on. Just click the tab at the top from anywhere to access it.&lt;br /&gt;
&lt;br /&gt;
Happy flashing!&lt;br /&gt;
&lt;br /&gt;
Sam&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-2005874021953778413?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/2005874021953778413/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2011/04/new-source-tab.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/2005874021953778413'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/2005874021953778413'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2011/04/new-source-tab.html' title='New Source Code Page'/><author><name>Samuel Halliday</name><uri>http://www.blogger.com/profile/08255033729298666891</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_KzkDV0Nap-k/TS8VqTEHHkI/AAAAAAAAAAM/N2xrmWM-xEs/s1600-R/44601_423221441783_504126783_5546568_1386913_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-2316575230418700224</id><published>2011-04-19T09:35:00.000-07:00</published><updated>2011-07-08T10:37:24.570-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Emergence'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='procedural generation'/><category scheme='http://www.blogger.com/atom/ns#' term='Source Code'/><title type='text'>Update: Colourful Turtle</title><content type='html'>In my &lt;a href="http://experimentalized.blogspot.com/2011/04/turtle-30-minute-experiment.html"&gt;last experiment&lt;/a&gt; I recreated a turtle vector drawing program, with a simple interface. I'll post a small update to that which adds some color to the output. Here are some screenshots, as usual click the first one to launch the image, and source code can be found at the bottom, enjoy and let me know if you make anything pretty!&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/TurtleColour.swf?height=550&amp;amp;width=550" imageanchor="1" rel="prettyPhoto[flash]" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="299" src="http://3.bp.blogspot.com/-chP86dB0BHQ/Ta23pyCn7RI/AAAAAAAAACk/_bhs8rlSyMg/s320/Screenshot-5.png" width="320"&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="299" src="http://2.bp.blogspot.com/-dNBXz1HHDw8/Ta23zux5TkI/AAAAAAAAACo/DNiK5xsxyQI/s320/Screenshot-4.png" width="320"&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="297" src="http://2.bp.blogspot.com/-ML4iDHUbEgo/Ta230naJ8aI/AAAAAAAAACs/Oq5tiTj72V0/s320/Screenshot-3.png" width="320"&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;a name="source"&gt;&lt;/a&gt;Source:&lt;br /&gt;
&lt;pre&gt;&lt;textarea cols="90" rows="10"&gt;package org.experimentalized
{
 import flash.display.Sprite;
 import flash.events.Event;
 import flash.events.KeyboardEvent;
 import flash.display.Graphics;
 import flash.text.TextField;
 import flash.text.TextFieldType;
 import flash.geom.Rectangle;
 import flash.utils.getTimer;

 [SWF(width='550',height='550',backgroundColor='#000000',frameRate='30')]

 public class Turtle extends Sprite
 {
  private var commandstring:String = new String("mv:30,lt:90,mv:10,rt:30");
  private var S:Sprite = new Sprite();
  private var Angle:Number = new Number(0);

  private var X:Number = 0;
  private var Y:Number = 0;

  private var R:int = 0;
  private var G:int = 0;
  private var B:int = 0;


  private var input:TextField = new TextField();

  
  private function newrun(e:KeyboardEvent):void
  {
    commandstring = input.text;
    S.graphics.clear();
    S.graphics.lineStyle(1,0xFFFFFF);
    S.graphics.moveTo(0,0);
    Angle = 0;
    X = 0;
    Y = 0;
  }

  public function Turtle():void
  {
   addEventListener(KeyboardEvent.KEY_DOWN, newrun);
  
   addChild(S);

   input.width = 530;
   input.height = 20;
                 input.x = 10;
                 input.y = 10;
                 input.background = true;
                 input.backgroundColor = 0xFFFFFF;
   input.type = TextFieldType.INPUT;
   
   input.text = commandstring;


   addChild(input);

   S.x = 275;
   S.y = 200;
      
   this.addEventListener(Event.ENTER_FRAME, handler);
  }
  
  private function handler(e:Event):void
  {
   R = int(128 * (1 + Math.cos(getTimer()/1000-0.8981)));
   G = int(128 * (1 + Math.sin(getTimer()/7473-0.3812)));
   B = int(128 * (1 + Math.sin(getTimer()/1273+0.1787)));
   
   var C:uint = (R&amp;lt;&amp;lt;16|G&amp;lt;&amp;lt;8|B);   
   
   S.graphics.lineStyle(1,C);
   var commands:Array = new Array();
   commandstring = commandstring.split(" ").join("");
   commands = commandstring.split(",");
   var i:int;

   for(i=0;i&amp;lt;commands.length;i++)
   {
    if(commands[i].charAt(0)=="m")
    {
     var dist:Number = Number(commands[i].split(" ").join("").split(":")[1]);
     X = X + dist*Math.cos(Angle);
     Y = Y + dist*Math.sin(Angle);
     S.graphics.lineTo(X,Y);
    }
    else if(commands[i].charAt(0)=="l")
    {
     var changeleft:Number = Number(commands[i].split(" ").join("").split(":")[1]);
     Angle -= Math.PI*changeleft/180;
     if(Angle&amp;lt;0) Angle += 2*Math.PI;
    }
    else if(commands[i].charAt(0)=="r")
    {
     var changeright:Number = Number(commands[i].split(" ").join("").split(":")[1]);
     Angle += Math.PI*changeright/180;
     if(Angle&amp;gt;Math.PI*2) Angle -= 2*Math.PI;
    }
   }
  

   //Resize to fit on the square after each iteration (purely aesthetic choice...)
   
   var Rect:Rectangle = S.getRect(S.parent);
   
   S.x += 275 - (Rect.x+Rect.width/2);
   S.y += 275 - (Rect.y+Rect.height/2);
   S.width = 550;
   S.height = 550;
  }
 }
}&lt;/textarea&gt;&lt;/pre&gt;&lt;div class="zemanta-pixie" style="margin-top:10px;height:15px"&gt;&lt;img class="zemanta-pixie-img" alt="" src="http://img.zemanta.com/pixy.gif?x-id=2772a1d3-7a98-48e3-bf42-5c967c46a4ec" style="border:none;float:right"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-2316575230418700224?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/2316575230418700224/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2011/04/update-colourful-turtle.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/2316575230418700224'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/2316575230418700224'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2011/04/update-colourful-turtle.html' title='Update: Colourful Turtle'/><author><name>Samuel Halliday</name><uri>http://www.blogger.com/profile/08255033729298666891</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_KzkDV0Nap-k/TS8VqTEHHkI/AAAAAAAAAAM/N2xrmWM-xEs/s1600-R/44601_423221441783_504126783_5546568_1386913_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-chP86dB0BHQ/Ta23pyCn7RI/AAAAAAAAACk/_bhs8rlSyMg/s72-c/Screenshot-5.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-8719119967217103468</id><published>2011-04-18T09:07:00.000-07:00</published><updated>2011-07-08T10:37:46.833-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Emergence'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='procedural generation'/><category scheme='http://www.blogger.com/atom/ns#' term='Source Code'/><title type='text'>Turtle: 30 minute experiment</title><content type='html'>I had recently been reminiscing about IT lessons in year 3 where we were allowed to play around with those Turtle vector drawing programs. I thought I'd write one and share the results as a quick break from revision. Although it can't do much at the moment (the only commands are forward, left and right) with a bit more work I'm sure it could be made into quite an exciting program. You'll find the source code below and as usual just click the top image to launch the experiment.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/Turtle.swf?height=400&amp;amp;width=550" imageanchor="1" rel="prettyPhoto[flash]" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="230" src="http://1.bp.blogspot.com/-lhkWbJAsa3Q/TaxhPVtAjvI/AAAAAAAAACQ/UMXUzhwEwCs/s320/Screenshot.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=8133808492150620948&amp;amp;postID=8719119967217103468" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="230" src="http://2.bp.blogspot.com/-6l1rX1z5xV4/TaxhQkg2-UI/AAAAAAAAACU/MgMYKv25-zE/s320/Screenshot-1.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=8133808492150620948&amp;amp;postID=8719119967217103468" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="230" src="http://3.bp.blogspot.com/-YG2kIHsCZ6A/TaxhRZOtQdI/AAAAAAAAACY/yw_rpHgP788/s320/Screenshot-2.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;a href="http://www.blogger.com/post-edit.g?blogID=8133808492150620948&amp;amp;postID=8719119967217103468" name="source"&gt;&lt;/a&gt;Source code:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;textarea cols="90" rows="10"&gt;
package org.experimentalized
{
 import flash.display.Sprite;
 import flash.events.Event;
 import flash.events.KeyboardEvent;
 import flash.display.BitmapData;
 import flash.display.Bitmap;
 import flash.display.Graphics;
 import flash.text.TextField;
 import flash.text.TextFieldType;

 [SWF(width='550',height='400',backgroundColor='#000000',frameRate='30')]

 public class Turtle extends Sprite
 {
  

  private var commandstring:String = new String("mv:30,lt:90,mv:10,rt:30");
  private var S:Sprite = new Sprite();
  private var Angle:Number = new Number(0);

  private var X:Number = 0;
  private var Y:Number = 0;

  private var input:TextField = new TextField();

  
  private function newrun(e:KeyboardEvent):void
  {
    commandstring = input.text;
    S.graphics.clear();
    S.graphics.lineStyle(1,0xFFFFFF);
    S.graphics.moveTo(0,0);
    Angle = 0;
    X = 0;
    Y = 0;
  }

  public function Turtle():void
  {
   addEventListener(KeyboardEvent.KEY_DOWN, newrun);
  
   addChild(S);

   input.width = 530;
   input.height = 20;
                 input.x = 10;
                 input.y = 10;
                 input.background = true;
                 input.backgroundColor = 0xFFFFFF;
   input.type = TextFieldType.INPUT;
   
   input.text = commandstring;


   addChild(input);

   S.x = 275;
   S.y = 200;
   
   S.graphics.lineStyle(1,0xFFFFFF); 
   
   this.addEventListener(Event.ENTER_FRAME, handler);
  }
  
  private function handler(e:Event):void
  {
   var commands:Array = new Array();
   commandstring = commandstring.split(" ").join("");
   commands = commandstring.split(",");
   var i:int;

   for(i=0;i&amp;lt;commands.length;i++)
   {
    if(commands[i].charAt(0)=="m")
    {
     var dist:Number = Number(commands[i].split(" ").join("").split(":")[1]);
     X = X + dist*Math.cos(Angle);
     Y = Y + dist*Math.sin(Angle);
     S.graphics.lineTo(X,Y);
    }
    else if(commands[i].charAt(0)=="l")
    {
     var changeleft:Number = Number(commands[i].split(" ").join("").split(":")[1]);
     Angle -= Math.PI*changeleft/180;
     if(Angle&amp;lt;0) Angle += 2*Math.PI;
    }
    else if(commands[i].charAt(0)=="r")
    {
     var changeright:Number = Number(commands[i].split(" ").join("").split(":")[1]);
     Angle += Math.PI*changeright/180;
     if(Angle&amp;gt;Math.PI*2) Angle -= 2*Math.PI;
    }
   } 
  }
 }
}&lt;/textarea&gt;
&lt;/pre&gt;&lt;br /&gt;
To make the output lines automatically fit the stage use the following instead:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;textarea cols="90" rows="10"&gt;
package org.experimentalized
{
 import flash.display.Sprite;
 import flash.events.Event;
 import flash.events.KeyboardEvent;
 import flash.display.Graphics;
 import flash.text.TextField;
 import flash.text.TextFieldType;
 import flash.geom.Rectangle;

 [SWF(width='550',height='550',backgroundColor='#000000',frameRate='30')]

 public class Turtle extends Sprite
 {
  private var commandstring:String = new String("mv:30,lt:90,mv:10,rt:30");
  private var S:Sprite = new Sprite();
  private var Angle:Number = new Number(0);

  private var X:Number = 0;
  private var Y:Number = 0;

  private var input:TextField = new TextField();
  
  private function newrun(e:KeyboardEvent):void
  {
    commandstring = input.text;
    S.graphics.clear();
    S.graphics.lineStyle(1,0xFFFFFF);
    S.graphics.moveTo(0,0);
    Angle = 0;
    X = 0;
    Y = 0;
  }

  public function Turtle():void
  {
   addEventListener(KeyboardEvent.KEY_DOWN, newrun);
  
   addChild(S);

   input.width = 530;
   input.height = 20;
                 input.x = 10;
                 input.y = 10;
                 input.background = true;
                 input.backgroundColor = 0xFFFFFF;
   input.type = TextFieldType.INPUT;
   
   input.text = commandstring;


   addChild(input);

   S.x = 275;
   S.y = 200;
      
   this.addEventListener(Event.ENTER_FRAME, handler);
  }
  
  private function handler(e:Event):void
  {
   
   S.graphics.lineStyle(1,0xFFFFFF);
   var commands:Array = new Array();
   commandstring = commandstring.split(" ").join("");
   commands = commandstring.split(",");
   var i:int;

   for(i=0;i&amp;lt;commands.length;i++)
   {
    if(commands[i].charAt(0)=="m")
    {
     var dist:Number = Number(commands[i].split(" ").join("").split(":")[1]);
     X = X + dist*Math.cos(Angle);
     Y = Y + dist*Math.sin(Angle);
     S.graphics.lineTo(X,Y);
    }
    else if(commands[i].charAt(0)=="l")
    {
     var changeleft:Number = Number(commands[i].split(" ").join("").split(":")[1]);
     Angle -= Math.PI*changeleft/180;
     if(Angle&amp;lt;0) Angle += 2*Math.PI;
    }
    else if(commands[i].charAt(0)=="r")
    {
     var changeright:Number = Number(commands[i].split(" ").join("").split(":")[1]);
     Angle += Math.PI*changeright/180;
     if(Angle&amp;gt;Math.PI*2) Angle -= 2*Math.PI;
    }
   }
  

   //Resize to fit on the square after each iteration (purely aesthetic choice...)
   
   var Rect:Rectangle = S.getRect(S.parent);
   
   S.x += 275 - (Rect.x+Rect.width/2);
   S.y += 275 - (Rect.y+Rect.height/2);
   S.width = 550;
   S.height = 550;
  }
 }
}
&lt;/textarea&gt;
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-8719119967217103468?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/8719119967217103468/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2011/04/turtle-30-minute-experiment.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/8719119967217103468'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/8719119967217103468'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2011/04/turtle-30-minute-experiment.html' title='Turtle: 30 minute experiment'/><author><name>Samuel Halliday</name><uri>http://www.blogger.com/profile/08255033729298666891</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_KzkDV0Nap-k/TS8VqTEHHkI/AAAAAAAAAAM/N2xrmWM-xEs/s1600-R/44601_423221441783_504126783_5546568_1386913_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-lhkWbJAsa3Q/TaxhPVtAjvI/AAAAAAAAACQ/UMXUzhwEwCs/s72-c/Screenshot.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-580002488414285368</id><published>2011-04-17T09:12:00.000-07:00</published><updated>2011-04-26T10:57:30.109-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='youtube'/><title type='text'>Large Scale Stop Frame</title><content type='html'>In my spare time I study physics at the University of Birmingham. We're currently having some building work done on our main courtyard, so with access to one of the security cameras from our main clock tower (provided by an unnamed physicist) I decided to document the events. I wrote a program which is currently running on the physics mainframe, which essentially grabs an image from the security camera every 2 minutes during the day. I compiled these images into a video (with about 6000 frames so far) and you'll find the initial results in the vid below:&lt;br /&gt;
&lt;br /&gt;
&lt;iframe allowfullscreen="" frameborder="0" height="390" src="http://www.youtube.com/embed/0my1KphyCkI" title="YouTube video player" width="640"&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
I plan on taking a few more weeks of images, the above is about 6 weeks. Enjoy.&lt;br /&gt;
&lt;br /&gt;
&lt;a name="source"&gt;&lt;/a&gt;For those of you who are interested here is the bash source code:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;textarea cols="90" rows="10"&gt;
#!/bin/bash
#PBS -j oe
#PBS -l walltime=240:00:00

CLOSING_TIME=1
WEEKEND=0

cd /home/st-01/pictures

while [ 1 ]
do
#Determine the current time
hour=$(echo `date +%k`)

#If the current time is between 9am and 6pm not inclusive
if [ $hour -gt 9 ] &amp;&amp; [ $hour -lt 18 ]; then
#Still taking photos - don't close up yet
CLOSING_TIME=0

#Retrieve image from the server and save it with a unique timestamp
wget http://YOURSITE.com/IMAGE.jpg
timestamp=$(echo `date +%y-%m-%d__%H:%M:%S`)
mv IMAGE.jpg ${timestamp}.jpg
else
#Otherwise must be the end of the day during the week
if [ "$CLOSING_TIME" == "0" ]; then

#ZIP UP THE IMAGES FOR THE DAY
date=$(echo `date +%y-%m-%d`)
zip ${date}.zip `ls *.jpg`
#Remove all non-zipped images
rm *.jpg
CLOSING_TIME=1
fi
fi
sleep 120
done

&lt;/textarea&gt;
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-580002488414285368?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/580002488414285368/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2011/04/large-scale-stop-frame.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/580002488414285368'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/580002488414285368'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2011/04/large-scale-stop-frame.html' title='Large Scale Stop Frame'/><author><name>Samuel Halliday</name><uri>http://www.blogger.com/profile/08255033729298666891</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_KzkDV0Nap-k/TS8VqTEHHkI/AAAAAAAAAAM/N2xrmWM-xEs/s1600-R/44601_423221441783_504126783_5546568_1386913_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/0my1KphyCkI/default.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-6859757786285122682</id><published>2011-01-19T11:14:00.000-08:00</published><updated>2011-04-26T10:56:52.863-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='webcam'/><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='augmented reality'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><title type='text'>Multi-Color-Space-Thresholding</title><content type='html'>A few months ago I was commissioned to create some background subtraction technology in flash. The project fell through at the time. The final product wasn't as stable as I'd hoped it might be. I thought that since the project fell through I would share some of my findings to see if the collective flash community might have any ideas or suggestions as to how one might implement this kind of technology.&lt;br /&gt;
&lt;br /&gt;
The idea of background subtraction is to separate two parts of an image, the foreground and a "static" background. Here is an example. Given the two images on the left, how does one extract the image on the right. You might think this is fairly easy, just look at the difference in color between the two you might say. Unfortunately it isn't as simple as this.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_KzkDV0Nap-k/TTczO6yR9PI/AAAAAAAAABo/cvZHwcwxCYs/s1600/Subtraction.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Firstly illumination and varying camera brightness cause a problem, not only does the foreground constantly change color, but also the background. Most web cams automatically adjust to a white point. You'll notice this if you hold a white sheet of paper against the web-cam, the background will dim. This means that in measuring the difference in RGB color for each pixel it is likely that the whole screen will be completely different from one frame to the next, not ideal if you want to separate out smaller regions!&lt;br /&gt;
&lt;br /&gt;
The method I chose to incorporate was to use multiple color spaces, combined in order to create a new color space which was optimum for this kind of a background subtraction scenario. Here is the program I used to determine the optimum subtraction for each color space. Just click on the image to launch it:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/bgs/BackgroundSubtraction.swf?height=800&amp;amp;width=660" imageanchor="1" rel="prettyPhoto[flash]" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://2.bp.blogspot.com/_KzkDV0Nap-k/TTc2RUpZ-4I/AAAAAAAAABs/WqSULB1KG84/s320/Test.png" width="262" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Initially a background is captured, the user steps out of the frame, and a still bitmap image is taken, then for each color space a comparison is made. If the difference between given pixels is greater than a threshold for any color component (or a combination of the three) then the pixel is deemed to be in the foreground. The three color spaces used in this case where YUV, normalized RGB and normalized YUV. The latter of these I haven't seen in use before, but it gives reasonable results.&lt;br /&gt;
&lt;br /&gt;
Once the image has been thresholded an alpha mask is applied to the current web-cam frame, and this image is used as the foreground. This allows some very impressive things to be done. The background can be replaced by an image, or another video (apple make use of this in their software Photo Booth), but more excitingly we now have two image planes, which means 3D!&lt;br /&gt;
&lt;br /&gt;
Here is an example of background replacement:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="233" src="http://2.bp.blogspot.com/_KzkDV0Nap-k/TTc8S4Nl47I/AAAAAAAAAB4/jVpRXvLWbRM/s320/Untitled+2.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
In the image below you'll see 3D in action (excuse the poor lighting conditions), click to launch it but remember, it probably won't work fantastically. Just click to launch it:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/bgs/Test.swf?height=400&amp;amp;width=550" imageanchor="1" rel="prettyPhoto[flash]" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="234" src="http://3.bp.blogspot.com/_KzkDV0Nap-k/TTc9UsHy8HI/AAAAAAAAAB8/ITHGcILXIE8/s320/Untitled.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
The 3D angle can be controlled by head position (motion tracking) allowing you to look around the person in front of the camera which is quite an interesting effect.&lt;br /&gt;
&lt;br /&gt;
The main issues with the project were that lighting conditions are constantly changing, and can vary hugely from web-cam to web-cam. There are other more computationally intensive approaches which flash may just about be able to handle, but unfortunately my brain cannot. Enjoy the experiment, and let me know how it works with your web-cams!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-6859757786285122682?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/6859757786285122682/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2011/01/multi-color-space-thresholding.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6859757786285122682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6859757786285122682'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2011/01/multi-color-space-thresholding.html' title='Multi-Color-Space-Thresholding'/><author><name>Samuel Halliday</name><uri>http://www.blogger.com/profile/08255033729298666891</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_KzkDV0Nap-k/TS8VqTEHHkI/AAAAAAAAAAM/N2xrmWM-xEs/s1600-R/44601_423221441783_504126783_5546568_1386913_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_KzkDV0Nap-k/TTczO6yR9PI/AAAAAAAAABo/cvZHwcwxCYs/s72-c/Subtraction.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-6281970508520830877</id><published>2011-01-19T09:06:00.000-08:00</published><updated>2011-01-19T09:12:02.030-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fractal'/><category scheme='http://www.blogger.com/atom/ns#' term='html5'/><category scheme='http://www.blogger.com/atom/ns#' term='canvas'/><category scheme='http://www.blogger.com/atom/ns#' term='Mandelbrot'/><title type='text'>HTML5 Mandelbrot Explorer</title><content type='html'>A simple Mandelbrot explorer for HTML5, in javascript. I plan on optimizing and extending the functionality of the example when I have a bit less uni work to keep up with.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/canvas/mandelbrot/?iframe=true&amp;width=800&amp;height=600" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="214" src="http://1.bp.blogspot.com/_KzkDV0Nap-k/TTcZ93mXSII/AAAAAAAAABk/LJgxPtyDoJ4/s320/Screenshot.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-6281970508520830877?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/6281970508520830877/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2011/01/html5-mandelbrot-explorer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6281970508520830877'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6281970508520830877'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2011/01/html5-mandelbrot-explorer.html' title='HTML5 Mandelbrot Explorer'/><author><name>Samuel Halliday</name><uri>http://www.blogger.com/profile/08255033729298666891</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_KzkDV0Nap-k/TS8VqTEHHkI/AAAAAAAAAAM/N2xrmWM-xEs/s1600-R/44601_423221441783_504126783_5546568_1386913_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_KzkDV0Nap-k/TTcZ93mXSII/AAAAAAAAABk/LJgxPtyDoJ4/s72-c/Screenshot.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-6881620456997675254</id><published>2011-01-18T03:45:00.000-08:00</published><updated>2011-01-18T14:17:52.654-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='html5'/><category scheme='http://www.blogger.com/atom/ns#' term='canvas'/><title type='text'>First Canvas Experiment: BitmapData</title><content type='html'>Lots of people have been talking about html 5 and canvas for a while now. As an actionscript purist I had decided not to venture into the world of incompatibility quite yet, but having seen some of the cool chrome experiments again recently, I decided to give writing some canvas toys a little go.&lt;br /&gt;
&lt;br /&gt;
My first experiment is a simple one, just some randomly updating pixels on a screen.&lt;br /&gt;
&lt;br /&gt;
&lt;canvas height="200" id="bitmap" width="300"&gt;Your browser doesn't support html5&lt;/canvas&gt;&lt;script src="http://experimentalized.com/experimentalized_blog/canvas/pixels/canvas.js" type="text/javascript"&gt;
&lt;/script&gt;&lt;br /&gt;
Here is the .js code:&lt;br /&gt;
&lt;pre&gt;function setPixel(bitmapData, x, y, r, g, b, a) {
index = (x + y * bitmapData.width) * 4;
bitmapData.data[index+0] = r;
bitmapData.data[index+1] = g;
bitmapData.data[index+2] = b;
bitmapData.data[index+3] = a;
}

element = document.getElementById("bitmap");
canvas = element.getContext("2d");
width = parseInt(element.getAttribute("width"));
height = parseInt(element.getAttribute("height"));

setInterval('update()',30);

function update()
{
bitmap = canvas.createImageData(width,height);
for (i = 0; i &amp;lt; 10000; i++) {
     x = parseInt(Math.random() * width);
     y = parseInt(Math.random() * height);
     r = parseInt(Math.random() * 256);
     g = parseInt(Math.random() * 256);
     b = parseInt(Math.random() * 256);
     setPixel(bitmap, x, y, r, g, b, 0xff);
 }
 canvas.putImageData(bitmap, 0, 0);
}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-6881620456997675254?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/6881620456997675254/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2011/01/first-canvas-experiment-bitmapdata.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6881620456997675254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6881620456997675254'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2011/01/first-canvas-experiment-bitmapdata.html' title='First Canvas Experiment: BitmapData'/><author><name>Samuel Halliday</name><uri>http://www.blogger.com/profile/08255033729298666891</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_KzkDV0Nap-k/TS8VqTEHHkI/AAAAAAAAAAM/N2xrmWM-xEs/s1600-R/44601_423221441783_504126783_5546568_1386913_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-750844419421651979</id><published>2011-01-15T14:07:00.000-08:00</published><updated>2011-01-15T14:11:35.395-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='ray tracing'/><category scheme='http://www.blogger.com/atom/ns#' term='raytracer'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>Transparency and Reflection</title><content type='html'>I haven't posted anything new on my blog in quite a while. Most of my time has been spent working on writing a fully function Actionscript plugin for Gedit, which will (with any luck) improve the development experience for users of Linux.&lt;br /&gt;
&lt;br /&gt;
Anyway I thought I'd post some eye candy, just a simple transition between two ASTrace renders. I be plan on working on a pixel bender filter to carry out these effects in real time. A kind of one-track raytracer which optimizes a single scene with a central sphere. This should be possible with two displacement filters, one for reflection and one for refraction. For now, here is a prototype without full 3D rotation (Click to launch then move the mouse left or right to change reflectivity):&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/TransparencyChanger.swf?height=291&amp;amp;width=400" imageanchor="1" rel="prettyPhoto[flash]" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="232" src="http://1.bp.blogspot.com/_KzkDV0Nap-k/TTIaOt9FJTI/AAAAAAAAAAw/WFmQFk_ABuI/s320/Transparent4.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-750844419421651979?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/750844419421651979/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2011/01/transparency-and-reflection.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/750844419421651979'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/750844419421651979'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2011/01/transparency-and-reflection.html' title='Transparency and Reflection'/><author><name>Samuel Halliday</name><uri>http://www.blogger.com/profile/08255033729298666891</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_KzkDV0Nap-k/TS8VqTEHHkI/AAAAAAAAAAM/N2xrmWM-xEs/s1600-R/44601_423221441783_504126783_5546568_1386913_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_KzkDV0Nap-k/TTIaOt9FJTI/AAAAAAAAAAw/WFmQFk_ABuI/s72-c/Transparent4.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-4422371417920960842</id><published>2010-12-04T16:11:00.000-08:00</published><updated>2010-12-05T05:42:16.117-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>Actionscript Debugging Working in GEDIT (Sort of...)</title><content type='html'>In my &lt;a href="http://experimentalized.blogspot.com/2010/12/compiling-flash-from-gedit.html"&gt;previous post&lt;/a&gt; I described how to write a shell script for Gedit under linux that would compile an actionscript/mxml project. I have come up with a reasonably good method for outputting trace statements to the Gedit console. Here is the script that I use to do it:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
EHOME=`echo $HOME | sed "s/#/\#/"`&lt;br /&gt;
DIR=$GEDIT_CURRENT_DOCUMENT_DIR&lt;br /&gt;
FILE=$GEDIT_CURRENT_DOCUMENT_NAME&lt;br /&gt;
EXT='swf'&lt;br /&gt;
&lt;br /&gt;
echo "Compiling: " $GEDIT_CURRENT_DOCUMENT_PATH&lt;br /&gt;
echo '--------------------'&lt;br /&gt;
&lt;br /&gt;
SWF=${FILE%as}${EXT}&lt;br /&gt;
&lt;br /&gt;
cd ${DIR%${FILE}} &amp;gt; /dev/stderr&lt;br /&gt;
&lt;br /&gt;
export PATH=/home/experimentalized/developer/sdks/flex_sdk/bin:$PATH&lt;br /&gt;
mxmlc -debug=true -static-link-runtime-shared-libraries=true ${FILE}&lt;br /&gt;
gnome-open ${SWF}&lt;br /&gt;
&lt;br /&gt;
echo "Waiting for Flash Player to connect"&lt;br /&gt;
sleep 4&lt;br /&gt;
&lt;br /&gt;
OUTPUTDIR=/home/experimentalized/.macromedia/Flash_Player/Logs/flashlog.txt&lt;br /&gt;
&lt;br /&gt;
TOTALLINES=`sed -n '$=' ${OUTPUTDIR}`&lt;br /&gt;
LINE=1&lt;br /&gt;
CURRENT=`sed -n "${LINE}{p;q}" ${OUTPUTDIR}`&lt;br /&gt;
&lt;br /&gt;
while [ "true" ]&lt;br /&gt;
do&amp;nbsp; &lt;br /&gt;
&amp;nbsp;if ps ax | grep -v grep | grep flashplayerdebugger &amp;gt; /dev/null&lt;br /&gt;
&amp;nbsp;then&lt;br /&gt;
&amp;nbsp; TOTALLINES=`sed -n '$=' ${OUTPUTDIR}`&lt;br /&gt;
&amp;nbsp; if [ "$TOTALLINES" -ge "$LINE" ]; then&lt;br /&gt;
&amp;nbsp;&amp;nbsp; CURRENT=`sed -n "${LINE}{p;q}" ${OUTPUTDIR}`&lt;br /&gt;
&amp;nbsp;&amp;nbsp; LINE=$(( $LINE + 1 ))&lt;br /&gt;
&amp;nbsp;&amp;nbsp; echo ${CURRENT}&lt;br /&gt;
&amp;nbsp; fi&lt;br /&gt;
&amp;nbsp;else&lt;br /&gt;
&amp;nbsp; break&lt;br /&gt;
&amp;nbsp;fi&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;/span&gt;&lt;/blockquote&gt;&amp;nbsp;The script initially does the same as the one in the previous post, but sets -debug to true. When the flash debug player runs it outputs data to a log file. This file is called flashlog.txt and is stored in ~/.macromedia/Flash_Player/Logs/ by default on linux. The script runs through lines in the trace output and echos them to the console one at a time. When it notices that the flash player is closed, it exits and when it reaches the last available line it stops tracing. It does in fact work (although there is a bit of latency as debugger writes to file -&amp;gt; is read by script isn't instantaneous). It may not be great for things like ENTER_FRAME events, and current mouse position, but it is enough for me. Just install it in the same way as I did in the previous post and set a key-shortcut like control-alt-d for debugging.&lt;br /&gt;
&lt;br /&gt;
I think I'm finally happy with my flash setup on Linux which is great (although code completion isn't there so I may take a look into that). Here are some screenshots:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" rel="prettyPhoto" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/TPrX-cNSiNI/AAAAAAAAArc/fXGGuCLSxVM/s1600/Screenshot-1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="374" src="http://3.bp.blogspot.com/_uea8fC_rl8A/TPrX-cNSiNI/AAAAAAAAArc/fXGGuCLSxVM/s640/Screenshot-1.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/TPrX-zbrc4I/AAAAAAAAArg/zoHZl3UhM9w/s1600/Screenshot-2.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="374" src="http://3.bp.blogspot.com/_uea8fC_rl8A/TPrX-zbrc4I/AAAAAAAAArg/zoHZl3UhM9w/s640/Screenshot-2.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="zemanta-pixie" style="height: 15px; margin-top: 10px;"&gt;&lt;img alt="" class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=a1172229-3f7c-4cd8-8ff1-f887b0085ab6" style="border: medium none; float: right;" /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-4422371417920960842?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/4422371417920960842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/12/actionscript-debugging-working-in-gedit.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/4422371417920960842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/4422371417920960842'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/12/actionscript-debugging-working-in-gedit.html' title='Actionscript Debugging Working in GEDIT (Sort of...)'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_uea8fC_rl8A/TPrX-cNSiNI/AAAAAAAAArc/fXGGuCLSxVM/s72-c/Screenshot-1.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-8496589092400517551</id><published>2010-12-04T06:05:00.000-08:00</published><updated>2010-12-05T03:55:55.179-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>Compiling Flash from GEDIT</title><content type='html'>In the previous post I discussed an option for developing flash on Linux, using the free flex sdk, and free software. The main problem I found was that every time I wanted to compile and run a file, I had to type some commands in the terminal. I'm pretty lazy when it comes to programming and I'm sure most of you agree that it helps to get everything working as fast as possible.&lt;br /&gt;
&lt;br /&gt;
To solve the issue I wrote a simple shell script which compiles and runs .as files, just like adobe flash does. This tutorial is for Linux users, if you're using windows I'd suggest using something like flashDevelop, which should do all of this for you anyway, if you're using Mac OS and can run Gedit from the terminal, it is an option but probable isn't ideal.&lt;br /&gt;
&lt;br /&gt;
So first off, if you haven't got it yet install Gedit and follow my previous tutorial&amp;nbsp; at:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://experimentalized.blogspot.com/2010/11/developing-flash-on-linux.html"&gt;http://experimentalized.blogspot.com/2010/11/developing-flash-on-linux.html&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Once everything is set up head into Gedit and go to Menu &amp;gt; Edit &amp;gt; Preferences &amp;gt; Plugins and enable the "External Tools" plugin. If you don't have it you'll have to install it.&lt;br /&gt;
&lt;br /&gt;
Exit Preferences and go to Menu &amp;gt; Tools &amp;gt; Manage External Tools...&lt;br /&gt;
&lt;br /&gt;
Click the icon with a green +, to create your own 'tool'. The idea is that when you run the tool, a shell script runs mxmlc on your currently open document, and then opens the generated swf in the flash debug player.&lt;br /&gt;
&lt;br /&gt;
In your new tool copy and paste the following&lt;br /&gt;
&lt;blockquote style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
EHOME=`echo $HOME | sed "s/#/\#/"`&lt;br /&gt;
DIR=$GEDIT_CURRENT_DOCUMENT_DIR&lt;br /&gt;
FILE=$GEDIT_CURRENT_DOCUMENT_NAME&lt;br /&gt;
EXT='swf'&lt;br /&gt;
&lt;br /&gt;
echo "Compiling: " $GEDIT_CURRENT_DOCUMENT_PATH&lt;br /&gt;
echo '--------------------'&lt;br /&gt;
&lt;br /&gt;
SWF=${FILE%as}${EXT}&lt;br /&gt;
&lt;br /&gt;
cd ${DIR%${FILE}} &amp;gt; /dev/stderr&lt;br /&gt;
&lt;br /&gt;
export PATH=PATH_TO_FLEX_SDK/bin:$PATH&lt;br /&gt;
mxmlc ${FILE}&lt;br /&gt;
gnome-open ${SWF}&lt;/blockquote&gt;replacing PATH_TO_FLEX_SDK with the complete path to your flex sdk (which you may have set up in the previous tutorial). If you haven't installed gnome-open use sudo apt-get install gnome-open in a terminal window.&lt;br /&gt;
&lt;br /&gt;
You can set up a shortcut key to run the script. Then go back to your project class and run the command! If everything has worked you should see a window with your newly compiled swf running inside it!&lt;br /&gt;
&lt;br /&gt;
There are a few problems with the script currently. Firstly the mxmlc compiler compiles to your src directory (wherever the actionscript file is). Second, there is still no debugging, which is a real shame. Gedit allows stdout to be displayed in the editor, so I am thinking of a way of displaying trace arguments right in Gedit. This would be an ideal solution to free and simple flash editing.&lt;br /&gt;
&lt;br /&gt;
Here are some images showing Gedit compiling flash:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/TPpKdEA_-0I/AAAAAAAAArQ/oGlbuY4_aNg/s1600/Screenshot.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="374" src="http://3.bp.blogspot.com/_uea8fC_rl8A/TPpKdEA_-0I/AAAAAAAAArQ/oGlbuY4_aNg/s640/Screenshot.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/TPpKesL5Q2I/AAAAAAAAArU/oI7uUq3D3t8/s1600/Screenshot-1.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="374" src="http://4.bp.blogspot.com/_uea8fC_rl8A/TPpKesL5Q2I/AAAAAAAAArU/oI7uUq3D3t8/s640/Screenshot-1.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-8496589092400517551?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/8496589092400517551/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/12/compiling-flash-from-gedit.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/8496589092400517551'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/8496589092400517551'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/12/compiling-flash-from-gedit.html' title='Compiling Flash from GEDIT'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_uea8fC_rl8A/TPpKdEA_-0I/AAAAAAAAArQ/oGlbuY4_aNg/s72-c/Screenshot.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-1677529974945172390</id><published>2010-11-22T06:50:00.000-08:00</published><updated>2010-12-05T03:55:19.317-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>Developing Flash on Linux</title><content type='html'>I recently bought a new net-book, and having no patience whatsoever with Windows 7 Starter, I decided to install Ubuntu. The OS works fantastically with only 1Gb of RAM and as a first time Linux user I was really impressed with the ease of use and customisability of Ubuntu. Clearly as a flash developer I needed a way to develop flash, to at least a basic level (I wasn't after full debugging or any fancy features, just a way to compile some apps and to allow me to work on the train or in front of the TV)!&lt;br /&gt;
&lt;br /&gt;
I decided to keep it simple; just a text editor with command-line compiling and testing.&lt;br /&gt;
&lt;br /&gt;
So here is how I did it:&lt;br /&gt;
&lt;br /&gt;
1. Install the flex sdk:&lt;br /&gt;
&lt;br /&gt;
The free SDK is downloadable from adobe ( &lt;a href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4"&gt;http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4&lt;/a&gt; ), I downloaded 4.5 to try out some of the new features, but you can choose the build that meets your requirements. Save the library somewhere to your local disk (I chose &lt;b&gt;/home/USER/developer/sdks/flex_sdk&lt;/b&gt;). The next step is to enable the terminal to access the executables in the flex_sdk which will build your programs.&lt;br /&gt;
&lt;br /&gt;
Open a new terminal and type &lt;b&gt;sudo nano ~/.bashrc&lt;/b&gt; (you may be asked to enter your password) and add the line:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;export PATH=/home/USER/developer/sdks/flex_sdk/bin:$PATH&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
to your bashrc file. To test it has worked restart the terminal type "which mxmlc",&amp;nbsp; it should echo the path you just provided.&lt;br /&gt;
&lt;br /&gt;
2. Download the Flash 10.1 Debugger for Linux:&lt;br /&gt;
&lt;br /&gt;
Download the Debugger and install it using:&lt;a href="http://www.blogger.com/"&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;$ cd /tmp&lt;br /&gt;
$ wget http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_10_linux.tar.gz&lt;br /&gt;
$ tar -zxvf install_flash_player_10_linux.tar.gz&lt;br /&gt;
$ cd install_flash_player_10_linux&lt;br /&gt;
$ ./flashplayer-installer&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
in your terminal.&lt;br /&gt;
&lt;br /&gt;
Hopefully you'll have a functioning debugger now. Check it works by finding an swf, setting all swfs to open with the flash player, and run gnome-open file.swf, and the debugger should open in the flash player.&lt;br /&gt;
&lt;br /&gt;
Failing this just use the flash for Firefox plugin.&lt;br /&gt;
&lt;br /&gt;
3. Install AS3 and MXML language files for Gedit:&lt;br /&gt;
&lt;br /&gt;
If you don't have Gedit, get it, its a great little text editor, and for me at least it does everything I need to (at least for editing AS3 files). Download the MXML and AS3 files from http://conic.se/blog/posts/8/ and copy them into &lt;b&gt;&lt;span class="inlineCode"&gt;~/.local/share/gtksourceview-2.0/language-specs/&lt;/span&gt;&lt;/b&gt;&lt;span class="inlineCode"&gt;. When you run Gedit you should be able to switch to the correct syntax highlighting for each language.&lt;/span&gt;&lt;br /&gt;
&lt;span class="inlineCode"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="inlineCode"&gt;Finally put all three together. Create a directory containing the actionscript library you want to compile, and in your command line run &lt;b&gt;mxmlc test.as&lt;/b&gt;. If you've followed the steps you should have created an swf. Finally run the swf using &lt;b&gt;gnome-open test.swf.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="inlineCode"&gt;Here are a few screenshots of the system in action:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/TOqC0ejZDRI/AAAAAAAAArM/Kc2F5qPFKCY/s1600/Screenshot-2.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="374" src="http://4.bp.blogspot.com/_uea8fC_rl8A/TOqC0ejZDRI/AAAAAAAAArM/Kc2F5qPFKCY/s640/Screenshot-2.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;span class="inlineCode"&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_uea8fC_rl8A/TOqCab2PsgI/AAAAAAAAArI/Gz8H9hKnCvo/s1600/Screenshot-1.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="374" src="http://1.bp.blogspot.com/_uea8fC_rl8A/TOqCab2PsgI/AAAAAAAAArI/Gz8H9hKnCvo/s640/Screenshot-1.png" width="640" /&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&amp;nbsp;Good luck developing AS3 in Linux&lt;/div&gt;&lt;span class="inlineCode"&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="inlineCode"&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-1677529974945172390?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/1677529974945172390/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/11/developing-flash-on-linux.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/1677529974945172390'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/1677529974945172390'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/11/developing-flash-on-linux.html' title='Developing Flash on Linux'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uea8fC_rl8A/TOqC0ejZDRI/AAAAAAAAArM/Kc2F5qPFKCY/s72-c/Screenshot-2.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-8677290073879621472</id><published>2010-11-01T03:28:00.000-07:00</published><updated>2010-12-05T03:54:51.969-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Libraries'/><category scheme='http://www.blogger.com/atom/ns#' term='ray tracing'/><category scheme='http://www.blogger.com/atom/ns#' term='raytracer'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>Some Beautiful Transparency Renders in ASTrace</title><content type='html'>My raytracing project has been on hold for a while as I have been fixing minor bugs and not really creating anything new. I am rewriting some features of the raytracer completely from scratch which will hopefully improve performance and clarity of the code. I will implement features such as bounding spheres for intersection tests, as well as possible octrees or similar to improve performance for large numbers of objects. Once the engine is working fully in flash I will port it to alchemy, and hopefully with those performance boosts the engine will be ready for distribution.&lt;br /&gt;
&lt;br /&gt;
Here are a few renders showing transparency and reflection that I created last night. Both are the same scene with different sky boxes applied. You can download the full size images (2200 by 1600px) by right clicking and saving as:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_uea8fC_rl8A/TM6VBUCCwmI/AAAAAAAAAq4/CGqeRYJq3tU/s1600/output.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="464" src="http://2.bp.blogspot.com/_uea8fC_rl8A/TM6VBUCCwmI/AAAAAAAAAq4/CGqeRYJq3tU/s640/output.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/TM6VxMol2YI/AAAAAAAAArA/5-uaw1KZjr0/s1600/output2.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="464" src="http://3.bp.blogspot.com/_uea8fC_rl8A/TM6VxMol2YI/AAAAAAAAArA/5-uaw1KZjr0/s640/output2.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-8677290073879621472?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/8677290073879621472/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/11/some-beautiful-transparency-renders-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/8677290073879621472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/8677290073879621472'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/11/some-beautiful-transparency-renders-in.html' title='Some Beautiful Transparency Renders in ASTrace'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_uea8fC_rl8A/TM6VBUCCwmI/AAAAAAAAAq4/CGqeRYJq3tU/s72-c/output.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-3032694737153428636</id><published>2010-10-28T13:00:00.000-07:00</published><updated>2010-12-05T03:54:19.547-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='Libraries'/><category scheme='http://www.blogger.com/atom/ns#' term='ray tracing'/><category scheme='http://www.blogger.com/atom/ns#' term='raytracer'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><category scheme='http://www.blogger.com/atom/ns#' term='Light'/><title type='text'>Soft Shadows in ASTrace</title><content type='html'>Here is a nice example of fully antialiased soft shadows. The source light uses about 20 seed points spread out using a pseudo-random function, to produce reasonable effects.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="464" src="http://1.bp.blogspot.com/_uea8fC_rl8A/TMnWPurYfwI/AAAAAAAAAq0/vWcOSlRz-vE/s640/output.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-3032694737153428636?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/3032694737153428636/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/10/soft-shadows-in-astrace.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/3032694737153428636'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/3032694737153428636'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/10/soft-shadows-in-astrace.html' title='Soft Shadows in ASTrace'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_uea8fC_rl8A/TMnWPurYfwI/AAAAAAAAAq0/vWcOSlRz-vE/s72-c/output.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-1658134981618395853</id><published>2010-10-27T15:34:00.000-07:00</published><updated>2010-10-28T02:49:28.067-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='Libraries'/><category scheme='http://www.blogger.com/atom/ns#' term='ray tracing'/><category scheme='http://www.blogger.com/atom/ns#' term='raytracer'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><title type='text'>Improved Supersampling and Antialiasing</title><content type='html'>I decided to improve the supersampling/antialiasing methods in my raytracer. Previously I applied a blur filter to the image after upsizing and then returned the image to its original size. This is not a very realistic or accurate antialiasing method so I decided to add some real supersampling to the raytracer. The two images below both have the same resolution, but the image on the right appears more realistic with fewer jagged edges. This is achieved by firing multiple rays for each pixel, and based on their relative position, calculate their contribution to the colour of that pixel. The obvious downside to this method is a largely increased rendering time, proportional to the number of rays per pixel. This means that 16 rays per pixel takes 16 times longer than a single ray. Quality definitely comes at a computational price. I think randomising the rays may improve the antialiased image quality, instead of firing them across a uniform grid and I will look into that.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/TMinwDeAaMI/AAAAAAAAAqs/NSqNjuxobNM/s1600/N.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_uea8fC_rl8A/TMinwDeAaMI/AAAAAAAAAqs/NSqNjuxobNM/s1600/N.png" /&gt;&lt;/a&gt;&lt;a href="http://1.bp.blogspot.com/_uea8fC_rl8A/TMinzE-ZXOI/AAAAAAAAAqw/5M3RL2rOdOo/s1600/AA.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_uea8fC_rl8A/TMinzE-ZXOI/AAAAAAAAAqw/5M3RL2rOdOo/s1600/AA.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
The next updates are likely to be cloud maps and a sun object (infinite directional lighting).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-1658134981618395853?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/1658134981618395853/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/10/improved-supersampling-and-antialiasing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/1658134981618395853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/1658134981618395853'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/10/improved-supersampling-and-antialiasing.html' title='Improved Supersampling and Antialiasing'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_uea8fC_rl8A/TMinwDeAaMI/AAAAAAAAAqs/NSqNjuxobNM/s72-c/N.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-1535616728099804885</id><published>2010-10-25T15:05:00.000-07:00</published><updated>2010-10-28T02:44:32.646-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='Libraries'/><category scheme='http://www.blogger.com/atom/ns#' term='ray tracing'/><category scheme='http://www.blogger.com/atom/ns#' term='raytracer'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><title type='text'>Perlin Texturing in ASTrace</title><content type='html'>I've added simplex noise volumetric texturing to ASTrace. I found &lt;a href="http://www.sjeiti.com/?p=473"&gt;this&lt;/a&gt; nice little Simplex noise class by &lt;a href="http://www.sjeiti.com/"&gt;Sjeiti&lt;/a&gt;&amp;nbsp;and implemented it in the library. Simplex is slightly faster than Perlin noise in 3 and 4 dimensions so it is ideal to use as a volumetric texture for primitives in the tracer, here are a few examples:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/TMX8R6coKWI/AAAAAAAAAqc/sQ-yIr8_kfA/s1600/Texturing2.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://4.bp.blogspot.com/_uea8fC_rl8A/TMX8R6coKWI/AAAAAAAAAqc/sQ-yIr8_kfA/s640/Texturing2.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/TMX8GMLIHSI/AAAAAAAAAqY/Hf5usvq_S_U/s1600/Texturing.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://3.bp.blogspot.com/_uea8fC_rl8A/TMX8GMLIHSI/AAAAAAAAAqY/Hf5usvq_S_U/s640/Texturing.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
As an extension I decided to create an animation using 4-dimensional simplex noise, just click on the image to launch it. I am planning on implementing a cloud sphere, and this would be ideal for animations of clouds:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/SimplexAnimation.swf?height=200&amp;amp;width=275" imageanchor="1" rel="prettyPhoto[flash]" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_uea8fC_rl8A/TMdM2Uf637I/AAAAAAAAAqg/tbyattbHo2I/s1600/screen.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span id="goog_1744773945"&gt;&lt;/span&gt;&lt;span id="goog_1744773946"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-1535616728099804885?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/1535616728099804885/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/10/perlin-texturing-in-astrace.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/1535616728099804885'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/1535616728099804885'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/10/perlin-texturing-in-astrace.html' title='Perlin Texturing in ASTrace'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uea8fC_rl8A/TMX8R6coKWI/AAAAAAAAAqc/sQ-yIr8_kfA/s72-c/Texturing2.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-8681429259174922096</id><published>2010-10-21T07:38:00.000-07:00</published><updated>2010-10-21T11:47:34.605-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='Libraries'/><category scheme='http://www.blogger.com/atom/ns#' term='ray tracing'/><category scheme='http://www.blogger.com/atom/ns#' term='raytracer'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><title type='text'>Material Properties</title><content type='html'>Choosing the right material to represent a particular object is important when producing realistic 3D graphics. Factors like refractive index, specularity, and reflectivity all affect how we perceive an object both in the real world and on screen, so ideally the real world case should be simulated as closely as possible in its computer based counterpart. The three images below show how differing physical features completely change the appearance of a scene. In the top image the sphere is 100% reflective, in the second it is partly transmissive and partly reflective and in the last image, the sphere is fully transmissive with a refractive index of around 1.08. I am pleased with the results I am getting from the raytracer, but adding more features increases the render time dramatically, especially for large numbers of objects. I am looking into porting the library to C++ for use in alchemy, which would show a dramatic increase in speed, possibly rendering scenes like the one below in real time. Till then &lt;a href="http://experimentalized.com/astrace.html"&gt;here&lt;/a&gt; is the library.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a rel="prettyPhoto" href="http://4.bp.blogspot.com/_uea8fC_rl8A/TMBOj80ThqI/AAAAAAAAAqM/lyrrB218zEs/s1600/Transparent4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="290" src="http://4.bp.blogspot.com/_uea8fC_rl8A/TMBOj80ThqI/AAAAAAAAAqM/lyrrB218zEs/s400/Transparent4.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a  rel="prettyPhoto" href="http://4.bp.blogspot.com/_uea8fC_rl8A/TMBOPMMpkuI/AAAAAAAAAqE/OrtNUM_arsU/s1600/Transparent2" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="290" src="http://4.bp.blogspot.com/_uea8fC_rl8A/TMBOPMMpkuI/AAAAAAAAAqE/OrtNUM_arsU/s400/Transparent2" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a  rel="prettyPhoto" href="http://2.bp.blogspot.com/_uea8fC_rl8A/TMBOmhaKZaI/AAAAAAAAAqQ/pOhnusHnwR8/s1600/Transparent3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="290" src="http://2.bp.blogspot.com/_uea8fC_rl8A/TMBOmhaKZaI/AAAAAAAAAqQ/pOhnusHnwR8/s400/Transparent3.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="zemanta-pixie" style="height: 15px; margin-top: 10px;"&gt;&lt;img alt="" class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=1d5ade2b-0083-44c9-9c62-b8eb3f22d674" style="border: none; float: right;" /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-8681429259174922096?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/8681429259174922096/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/10/material-properties.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/8681429259174922096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/8681429259174922096'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/10/material-properties.html' title='Material Properties'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uea8fC_rl8A/TMBOj80ThqI/AAAAAAAAAqM/lyrrB218zEs/s72-c/Transparent4.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-7472543666858916402</id><published>2010-10-21T02:08:00.000-07:00</published><updated>2011-07-08T10:38:29.319-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='Libraries'/><category scheme='http://www.blogger.com/atom/ns#' term='ray tracing'/><category scheme='http://www.blogger.com/atom/ns#' term='raytracer'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Source Code'/><title type='text'>ASTrace Pre Release</title><content type='html'>Although the library is nowhere near complete, I thought I would release a beta to see what you think. At this stage feedback would be really useful, including any suggestions you might have about extensions to the project. I should note that there is no documentation as of yet, this will be coming as soon as I manage to get asdoc to run properly. There should be plenty of scope for you to play around with the library, it'd be great if you could send me some of your renders.&lt;br /&gt;
&lt;br /&gt;
Here is a link to the library: &lt;a href="http://experimentalized.com/astrace.html"&gt;ASTRACE&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
and here are some of my favourite renders using the library:&lt;br /&gt;
&lt;br /&gt;
&lt;table border="0" style="width: 600px;"&gt;&lt;tbody&gt;
&lt;tr&gt;     &lt;td&gt;&lt;img height="180" src="http://experimentalized.com/raytracer_screenshots/Fog.png" width="300" /&gt;&lt;/td&gt;     &lt;td&gt;&lt;img height="180" src="http://experimentalized.com/raytracer_screenshots/Recursive.png" width="300" /&gt;&lt;/td&gt;   &lt;/tr&gt;
&lt;tr&gt;     &lt;td&gt;&lt;img height="180" src="http://experimentalized.com/raytracer_screenshots/Visible.png" width="300" /&gt;&lt;/td&gt;     &lt;td&gt;&lt;img height="180" src="http://experimentalized.com/raytracer_screenshots/Refraction.png" width="300" /&gt;&lt;/td&gt;   &lt;/tr&gt;
&lt;tr&gt;     &lt;td&gt;&lt;img height="180" src="http://experimentalized.com/raytracer_screenshots/Environment.png" width="300" /&gt;&lt;/td&gt;     &lt;td&gt;&lt;img height="180" src="http://experimentalized.com/raytracer_screenshots/SeaFiltered.png" width="300" /&gt;&lt;/td&gt;   &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-7472543666858916402?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/7472543666858916402/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/10/astrace-pre-release.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/7472543666858916402'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/7472543666858916402'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/10/astrace-pre-release.html' title='ASTrace Pre Release'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-4849782363646823201</id><published>2010-10-11T08:50:00.000-07:00</published><updated>2010-10-18T03:14:01.523-07:00</updated><title type='text'>Some more ray tracer features</title><content type='html'>Here are a few more demos of new raytracer features:&lt;br /&gt;
&lt;br /&gt;
Water (with transparency and reflection):&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a rel="prettyPhoto"  href="http://1.bp.blogspot.com/_uea8fC_rl8A/TLwd01mrGhI/AAAAAAAAAqA/a_7JQ2HzB0M/s1600/Water.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://1.bp.blogspot.com/_uea8fC_rl8A/TLwd01mrGhI/AAAAAAAAAqA/a_7JQ2HzB0M/s640/Water.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Environment and Texture Mapping:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/TLwFAe9WqnI/AAAAAAAAAp8/LbGUExHszc0/s1600/Space.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://3.bp.blogspot.com/_uea8fC_rl8A/TLwFAe9WqnI/AAAAAAAAAp8/LbGUExHszc0/s640/Space.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_uea8fC_rl8A/TLwEUh-EbRI/AAAAAAAAAp0/wLwf9Up8opE/s1600/Eclipse.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://1.bp.blogspot.com/_uea8fC_rl8A/TLwEUh-EbRI/AAAAAAAAAp0/wLwf9Up8opE/s640/Eclipse.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Fog - Linear, Square and Exponential decay&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_uea8fC_rl8A/TLv8A52ZVSI/AAAAAAAAApw/s6LKGSQg_7Y/s1600/Fog.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://1.bp.blogspot.com/_uea8fC_rl8A/TLv8A52ZVSI/AAAAAAAAApw/s6LKGSQg_7Y/s640/Fog.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Visible Lights (ideal for rendering sunlight, lamps etc):&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_uea8fC_rl8A/TLMvxCaQA9I/AAAAAAAAApk/OMgsUVRYrTM/s1600/Visible_Light_Source_2.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" ex="true" height="400" src="http://2.bp.blogspot.com/_uea8fC_rl8A/TLMvxCaQA9I/AAAAAAAAApk/OMgsUVRYrTM/s640/Visible_Light_Source_2.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Soft Lighting (one soft light with 10 seeds - therefore only noticable on some shadows):&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_uea8fC_rl8A/TLMtqd1mHoI/AAAAAAAAApg/qU1Ibuz1bf8/s1600/Soft_Lighting_1.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" ex="true" height="354" src="http://2.bp.blogspot.com/_uea8fC_rl8A/TLMtqd1mHoI/AAAAAAAAApg/qU1Ibuz1bf8/s640/Soft_Lighting_1.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Triangular Faces:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/TLMtTOllkJI/AAAAAAAAApc/wydvQODiR0o/s1600/Triangles.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" ex="true" height="400" src="http://4.bp.blogspot.com/_uea8fC_rl8A/TLMtTOllkJI/AAAAAAAAApc/wydvQODiR0o/s640/Triangles.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Transparency (with refraction, internal reflection etc):&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_uea8fC_rl8A/TLMxTbzVEzI/AAAAAAAAApo/75MO6Vyq0NE/s1600/Transparency_1.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" ex="true" height="400" src="http://2.bp.blogspot.com/_uea8fC_rl8A/TLMxTbzVEzI/AAAAAAAAApo/75MO6Vyq0NE/s640/Transparency_1.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: left;"&gt;﻿A few more features are on their way (including UV mapping, environment mapping, and Fresnel shaders)&amp;nbsp;and once those features are finished I will release the library.&lt;/div&gt;&lt;div class="zemanta-pixie" style="height: 15px; margin-top: 10px;"&gt;&lt;img alt="" class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=af8d15a7-b12b-4a0e-beb1-77be8f112228" style="border: none; float: right;" /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-4849782363646823201?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/4849782363646823201/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/10/some-more-ray-tracer-features.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/4849782363646823201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/4849782363646823201'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/10/some-more-ray-tracer-features.html' title='Some more ray tracer features'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_uea8fC_rl8A/TLwd01mrGhI/AAAAAAAAAqA/a_7JQ2HzB0M/s72-c/Water.png' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-3903105519859787361</id><published>2010-09-23T11:31:00.000-07:00</published><updated>2010-09-23T14:37:46.909-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ray tracing'/><category scheme='http://www.blogger.com/atom/ns#' term='raytracer'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><title type='text'>Reflective Recursion</title><content type='html'>With the exception of refraction, which I am not yet happy with (total internal reflection problems), the raytracer is coming together fantastically. This is my&amp;nbsp;favourite render so far featuring diffuse and specular reflections with 2 pass antialiasing. The image was rendered at 2200x1600 and cropped to give the final image:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/TJucXqNPKFI/AAAAAAAAApM/di0o-RV-N0M/s1600/crop.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="416" src="http://3.bp.blogspot.com/_uea8fC_rl8A/TJucXqNPKFI/AAAAAAAAApM/di0o-RV-N0M/s640/crop.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Not bad for flash, about 30 minutes render time.&lt;br /&gt;
&lt;br /&gt;
Once mathematical problems with internal reflection are fixed I will be releasing the library under an open source license, let me know if you have any last minute requests!&lt;br /&gt;
&lt;br /&gt;
Below is a similar image but rendered to 3300x2400 pixels in about 90 minutes:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a rel="prettyPhoto" href="http://4.bp.blogspot.com/_uea8fC_rl8A/TJvINr5wbDI/AAAAAAAAApU/-kDUu2MVnp4/s1600/hr.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="466" src="http://4.bp.blogspot.com/_uea8fC_rl8A/TJvINr5wbDI/AAAAAAAAApU/-kDUu2MVnp4/s640/hr.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-3903105519859787361?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/3903105519859787361/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/09/reflective-recursion.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/3903105519859787361'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/3903105519859787361'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/09/reflective-recursion.html' title='Reflective Recursion'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_uea8fC_rl8A/TJucXqNPKFI/AAAAAAAAApM/di0o-RV-N0M/s72-c/crop.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-2047113692917904675</id><published>2010-09-20T08:00:00.000-07:00</published><updated>2010-09-23T11:33:13.762-07:00</updated><title type='text'>New Ray Tracer Features</title><content type='html'>I mentioned a short while ago that I was creating a brand new ray tracer for actionscript 3. It is beginning to take shape and I thought I'd run through a quick feature list:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Objects: spheres, planes, boxes - triangular meshes in the pipeline&lt;/li&gt;
&lt;li&gt;Materials - reflective, transparent, bitmap&lt;/li&gt;
&lt;li&gt;Unlimited reflection and refraction (within reason)&lt;/li&gt;
&lt;li&gt;Direction lighting (multiple light points)&lt;/li&gt;
&lt;li&gt;Phong shading&lt;/li&gt;
&lt;li&gt;Camera with 6 degrees of freedom&lt;/li&gt;
&lt;li&gt;Sky object - simple sky rendering&lt;/li&gt;
&lt;li&gt;Save output as .JPG, .PNG or .BMP&lt;/li&gt;
&lt;li&gt;Render progress&lt;/li&gt;
&lt;li&gt;Color lights&lt;/li&gt;
&lt;li&gt;Soft lighting&lt;/li&gt;
&lt;li&gt;Low resolution real-time rendering (for small numbers of objects/lights)&lt;/li&gt;
&lt;li&gt;Antialiasing and effects&lt;/li&gt;
&lt;li&gt;Anaglyph rendering&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;
No doubt the feature list will grow and let me know if you have any requests. I would really like to have curved surface and formula collisions as part of the package, so I'll try to get this working then release the library under the name ASTrace. Currently the first below (10 spheres, 1100x800 resolution, 1 light) renders in about 10 seconds which I am very happy with, and the second scene (30 spheres, 1100x800, 1 light, 10 reflections) in about 150 seconds - not so good, but not bad.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/TJd0-gCD2XI/AAAAAAAAAoU/Vp1ha7Q4UzY/s1600/output.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="466" src="http://3.bp.blogspot.com/_uea8fC_rl8A/TJd0-gCD2XI/AAAAAAAAAoU/Vp1ha7Q4UzY/s640/output.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_uea8fC_rl8A/TJd7gB5wSHI/AAAAAAAAAok/o9yuE80Oeak/s1600/output.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="466" src="http://2.bp.blogspot.com/_uea8fC_rl8A/TJd7gB5wSHI/AAAAAAAAAok/o9yuE80Oeak/s640/output.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;I will post demos up as I make them, here is one showing reflection and planes. It looks like there is something wrong with the reflections despite the render looking fantastic, so I will look into that (100 seconds, 1100x800):&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/TJeAJ262ipI/AAAAAAAAAos/TWFPmI8owBw/s1600/output.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="466" src="http://3.bp.blogspot.com/_uea8fC_rl8A/TJeAJ262ipI/AAAAAAAAAos/TWFPmI8owBw/s640/output.png" width="640" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style="text-align: left;"&gt;Another nice demo, still haven't fixed the reflection problem though:&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/TJe2zmiM4LI/AAAAAAAAAo0/ObxcHBmiNaM/s1600/output.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="466" src="http://4.bp.blogspot.com/_uea8fC_rl8A/TJe2zmiM4LI/AAAAAAAAAo0/ObxcHBmiNaM/s640/output.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
A new example with the reflection problem ironed out (50 spheres, 2200x1600, about 15 minutes):&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/TJp0KTuRAiI/AAAAAAAAAo8/jhqOOuMnaB4/s1600/output.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="466" src="http://3.bp.blogspot.com/_uea8fC_rl8A/TJp0KTuRAiI/AAAAAAAAAo8/jhqOOuMnaB4/s640/output.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;div style="text-align: left;"&gt;An example showing antialiasing and plane/sphere reflection:&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_uea8fC_rl8A/TJtkWhVVZAI/AAAAAAAAApE/OG0_Klv7Rvc/s1600/spec_aa.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="466" src="http://1.bp.blogspot.com/_uea8fC_rl8A/TJtkWhVVZAI/AAAAAAAAApE/OG0_Klv7Rvc/s640/spec_aa.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="zemanta-pixie" style="height: 15px; margin-top: 10px;"&gt;&lt;img alt="" class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=fa2c1175-39dc-46e0-bb8a-4b2141f1e8f6" style="border: none; float: right;" /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-2047113692917904675?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/2047113692917904675/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/09/new-ray-tracer-features.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/2047113692917904675'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/2047113692917904675'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/09/new-ray-tracer-features.html' title='New Ray Tracer Features'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_uea8fC_rl8A/TJd0-gCD2XI/AAAAAAAAAoU/Vp1ha7Q4UzY/s72-c/output.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-8798344267394703381</id><published>2010-09-12T09:36:00.000-07:00</published><updated>2010-09-12T11:37:40.640-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Animation'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>Underwater Scene</title><content type='html'>Just created quite a nice little underwater scene, with bubbles and lighting. Just need to add some fish! I've been finding it quite relaxing just to watch. It is completely dynamically resizable just like the &lt;a href="http://experimentalized.blogspot.com/2010/04/nice-little-cloud-effect.html"&gt;cloud background&lt;/a&gt;&amp;nbsp;I made a few months ago. Click to launch it.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a rel="prettyPhoto[flash]" href="http://experimentalized.com/experimentalized_blog/flsh/Sea.swf?height=600&amp;width=825" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="440" src="http://1.bp.blogspot.com/_uea8fC_rl8A/TI0ArbwoMLI/AAAAAAAAAoI/hIc1bCndV2k/s640/Sea.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-8798344267394703381?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/8798344267394703381/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/09/underwater-scene.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/8798344267394703381'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/8798344267394703381'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/09/underwater-scene.html' title='Underwater Scene'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_uea8fC_rl8A/TI0ArbwoMLI/AAAAAAAAAoI/hIc1bCndV2k/s72-c/Sea.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-5279477268611158234</id><published>2010-09-11T15:07:00.000-07:00</published><updated>2010-09-12T11:37:16.859-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pixel bender'/><category scheme='http://www.blogger.com/atom/ns#' term='Cellular Automata'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><title type='text'>Conway's Game Of Life using Pixelbender</title><content type='html'>Couldn't resist trying to create a pixelbender filter for use in the Game of Life. In an &lt;a href="http://experimentalized.blogspot.com/2009/05/conways-game-of-life.html"&gt;article&lt;/a&gt; a few years ago I created a simple&amp;nbsp;Life&amp;nbsp;application. Pixelbender has the potential to massively increase the speed of calculations such as those used in Life, the results are obvious. On top of this the simplicity within flash is fantastic, to advance the game you simply need to apply a filter to a bitmapData object. Click to launch the app:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/conway2.swf?height=600&amp;amp;width=825" imageanchor="1" rel="prettyPhoto[flash]" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="465" src="http://1.bp.blogspot.com/_uea8fC_rl8A/TIv9UWfyvmI/AAAAAAAAAoA/haHj9Uyu5K0/s640/Screen.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-5279477268611158234?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/5279477268611158234/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/09/conways-game-of-life-using-pixelbender.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/5279477268611158234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/5279477268611158234'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/09/conways-game-of-life-using-pixelbender.html' title='Conway&apos;s Game Of Life using Pixelbender'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_uea8fC_rl8A/TIv9UWfyvmI/AAAAAAAAAoA/haHj9Uyu5K0/s72-c/Screen.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-1713819127752513783</id><published>2010-09-11T10:27:00.001-07:00</published><updated>2010-09-12T11:36:57.651-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><category scheme='http://www.blogger.com/atom/ns#' term='webdesign'/><title type='text'>Experimentalized - New Look</title><content type='html'>Just updated my homepage, check it out &lt;a href="http://experimentalized.com/"&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a rel="prettyPhoto" href="http://2.bp.blogspot.com/_uea8fC_rl8A/TIu8gNLgAII/AAAAAAAAAn4/mlBpJTS5YYI/s1600/Site.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="516" src="http://2.bp.blogspot.com/_uea8fC_rl8A/TIu8gNLgAII/AAAAAAAAAn4/mlBpJTS5YYI/s640/Site.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-1713819127752513783?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/1713819127752513783/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/09/experimentalized-new-look.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/1713819127752513783'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/1713819127752513783'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/09/experimentalized-new-look.html' title='Experimentalized - New Look'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_uea8fC_rl8A/TIu8gNLgAII/AAAAAAAAAn4/mlBpJTS5YYI/s72-c/Site.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-6051478342890187751</id><published>2010-09-11T03:56:00.001-07:00</published><updated>2010-09-12T11:36:41.393-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='webcam'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='User Interface'/><title type='text'>Real Time Regional Differencing</title><content type='html'>I little while ago I produced a method for extracting interesting regions from images which I called regional differencing (see &lt;a href="http://experimentalized.blogspot.com/2010/07/computer-vision-regional-differencing.html"&gt;post&lt;/a&gt;). I have optimised the code, and it now runs in real time. It works very well as a simple edge detector with the ability to produce much thinner lines than the Sobel detector, notice in the image below the maximum line thickness is one pixel. The algorithm works by comparing more and less pixelated versions of an image to find local differences compared to a local mean.&lt;br /&gt;
&lt;br /&gt;
To improve the algorithm I switched from the RGB colour space to NUV as this improved results (albeit reducing performance marginally). The detector doesn't quite have the quality of something like the &lt;a href="http://en.wikipedia.org/wiki/Canny_edge_detector"&gt;Canny detector&lt;/a&gt;, but it requires a lot less processing which in flash is very important!&lt;br /&gt;
&lt;br /&gt;
Anyway check out the demo by clicking on the link below, the slider changes the pixel size of the comparison bitmap, with some interesting results. The default settings use a size of 2 pixels producing lines of a maximum one pixel thick.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a rel="prettyPhoto" href="http://experimentalized.com/experimentalized_blog/flsh/RTRD.swf?height=400&amp;amp;width=550" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_uea8fC_rl8A/TIu7FG_E01I/AAAAAAAAAnw/MCrP0ef4GNU/s320/Screen.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-6051478342890187751?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/6051478342890187751/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/09/real-time-regional-differencing_11.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6051478342890187751'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6051478342890187751'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/09/real-time-regional-differencing_11.html' title='Real Time Regional Differencing'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_uea8fC_rl8A/TIu7FG_E01I/AAAAAAAAAnw/MCrP0ef4GNU/s72-c/Screen.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-5645239347602466082</id><published>2010-09-10T07:05:00.000-07:00</published><updated>2010-09-12T11:35:34.359-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='webcam'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='youtube'/><category scheme='http://www.blogger.com/atom/ns#' term='User Interface'/><title type='text'>Visual Human Interfaces</title><content type='html'>Making human interfaces intuitive, simple and accurate is a huge challenge. Some of the biggest challenges lie in the field of motion and gesture detection. Analysing visual data in real time can be very processor intensive.&lt;br /&gt;
&lt;br /&gt;
This is a fairly simple implementation of an interface which has the ability to track on screen button presses and swipes (it is part of an ongoing research project):&lt;br /&gt;
&lt;br /&gt;
Click to launch a demo video:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a rel="prettyPhoto"  href="http://www.youtube.com/watch?v=UMbH7W5zBvQ" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_uea8fC_rl8A/TIo7HDFzzOI/AAAAAAAAAnc/pAg3mQyio0U/s320/Screen.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-5645239347602466082?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/5645239347602466082/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/09/visual-human-interfaces.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/5645239347602466082'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/5645239347602466082'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/09/visual-human-interfaces.html' title='Visual Human Interfaces'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uea8fC_rl8A/TIo7HDFzzOI/AAAAAAAAAnc/pAg3mQyio0U/s72-c/Screen.png' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-1694274307488450542</id><published>2010-09-06T05:07:00.001-07:00</published><updated>2010-09-06T05:15:53.983-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='webcam'/><category scheme='http://www.blogger.com/atom/ns#' term='pixel bender'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><title type='text'>Crossfade Using Pixelbender</title><content type='html'>I am currently doing some work for a client which involves background subtraction. I have been getting into using pixel bender to calculate filters in flash for a while now, but doing some research I found there is actually huge scope for using pixel bender to carry out other calculations (see &lt;a href="http://blog.yoz.sk/2010/08/pixel-bender-inputs-vector-or-bytearray/#more-2105"&gt;this&lt;/a&gt; article).&lt;br /&gt;
&lt;br /&gt;
The following example uses pixel bender as a part of the background subtraction process. Consecutive frames from the webcam are blended with all previous frames. The eventual result is to produce a good estimate of the background pixels. The example uses the blendShader property of a display object with blend mode set to BlendMode.SHADER, and a custom Pixelbender shader that mixes pixels. Check it out (click to launch):&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a rel="prettyPhoto[flash]"  href="http://experimentalized.com/experimentalized_blog/flsh/CrossFade.swf?height=400&amp;width=550" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_uea8fC_rl8A/TITa9nAejVI/AAAAAAAAAnU/CmLL6aWeCVg/s320/Untitled.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-1694274307488450542?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/1694274307488450542/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/09/crossfade-using-pixelbender.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/1694274307488450542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/1694274307488450542'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/09/crossfade-using-pixelbender.html' title='Crossfade Using Pixelbender'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_uea8fC_rl8A/TITa9nAejVI/AAAAAAAAAnU/CmLL6aWeCVg/s72-c/Untitled.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-4596783671839451177</id><published>2010-08-31T08:32:00.000-07:00</published><updated>2010-09-12T11:34:47.275-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ray tracing'/><category scheme='http://www.blogger.com/atom/ns#' term='raytracer'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><title type='text'>Ray Tracing Library AS3</title><content type='html'>About a year ago I wrote a ray tracer. I've decided to the same thing again, building from the ground up, and taking a completely OOP approach - which I didn't do before. I was very pleased with previous results, but given the lack of structure implementing certain features became a real headache, and a lot of code had to be rewritten each time I wanted to make a small change.&lt;br /&gt;
&lt;br /&gt;
At the same time I will try to speed up the engine, try to stick to bitwise operators and vectors whenever possible. With any luck it'll be up and running in the next few weeks, but I will keep you updated along the way.&lt;br /&gt;
&lt;br /&gt;
Here are some screenshots from the previous ray tracer:&lt;br /&gt;
&lt;br /&gt;
&lt;a rel="prettyPhoto" href="http://3.bp.blogspot.com/_uea8fC_rl8A/TH0gNZBeTYI/AAAAAAAAAnM/OeVQd332I-w/s1600/reflections-1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/_uea8fC_rl8A/TH0gNZBeTYI/AAAAAAAAAnM/OeVQd332I-w/s320/reflections-1.png" width="320"&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a rel="prettyPhoto" href="http://1.bp.blogspot.com/_uea8fC_rl8A/TH0gG1E2lBI/AAAAAAAAAnE/mTqZFAFv7jo/s1600/reflections3pass.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/_uea8fC_rl8A/TH0gG1E2lBI/AAAAAAAAAnE/mTqZFAFv7jo/s320/reflections3pass.png" width="320"&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="zemanta-pixie" style="margin-top:10px;height:15px"&gt;&lt;img class="zemanta-pixie-img" alt="" src="http://img.zemanta.com/pixy.gif?x-id=193e5ce1-3270-4f9c-9595-bea1ec40b3a1" style="border:none;float:right"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-4596783671839451177?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/4596783671839451177/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/08/ray-tracing-library-as3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/4596783671839451177'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/4596783671839451177'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/08/ray-tracing-library-as3.html' title='Ray Tracing Library AS3'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_uea8fC_rl8A/TH0gNZBeTYI/AAAAAAAAAnM/OeVQd332I-w/s72-c/reflections-1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-6242350330890985764</id><published>2010-08-09T03:29:00.000-07:00</published><updated>2010-08-09T03:29:21.189-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mathematics'/><category scheme='http://www.blogger.com/atom/ns#' term='Classes'/><title type='text'>FlashMath Demo 1</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/TF_Vp1Tnk-I/AAAAAAAAAms/1QD97iM36lc/s1600/Logo_Med.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="188" src="http://4.bp.blogspot.com/_uea8fC_rl8A/TF_Vp1Tnk-I/AAAAAAAAAms/1QD97iM36lc/s200/Logo_Med.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;Just a really simple demo, which uses the FlashMath library. Click to launch it. The demo uses a string evaluation function to generate the curve. This function is also used to calculate the integral of the curve using Simpsons rule between min and max, and by clicking on the graph, finite differencing is used to calculate the gradient of the curve. Data set and graph classes are used to store / draw the data. The parser was created by&amp;nbsp;&lt;a href="http://www.undefined.ch/"&gt;http://www.undefined.ch/&lt;/a&gt;&amp;nbsp;and is a really useful tool! The demo might be a bit buggy at the moment, but its a good sign of things to come!&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a rel="prettyPhoto[flash]" href="http://experimentalized.com/experimentalized_blog/flsh/Graph.swf?height=400&amp;width=550" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="291" src="http://1.bp.blogspot.com/_uea8fC_rl8A/TF_V7hH9zYI/AAAAAAAAAm0/sm-eHK44iMM/s400/Screen.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-6242350330890985764?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/6242350330890985764/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/08/flashmath-demo-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6242350330890985764'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6242350330890985764'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/08/flashmath-demo-1.html' title='FlashMath Demo 1'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uea8fC_rl8A/TF_Vp1Tnk-I/AAAAAAAAAms/1QD97iM36lc/s72-c/Logo_Med.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-258661825375016903</id><published>2010-08-03T14:26:00.000-07:00</published><updated>2010-08-08T07:05:05.633-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mathematics'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Classes'/><title type='text'>Experimentalized Maths Library</title><content type='html'>It struck me today, that although I reuse a lot of code and classes, the one thing I tend to rewrite each and every time I start a new program is the mathematics. I dread to think how many hours this has wasted me over the years, so I finally decided to write a toolkit encompassing almost anything maths based. So far I've written a couple of constant utilities, one for mathematical constants, and one for scientific constants and a complex number class. Currently on the list are:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Matrices&lt;/li&gt;
&lt;li&gt;Data sampling and statistics&lt;/li&gt;
&lt;li&gt;Quadrature (integration) - Rectangle, Trapezium &amp;amp; Simpson's rule&amp;nbsp;&lt;span class="Apple-style-span" style="color: #333333; font-family: Times, 'Times New Roman', serif; line-height: 16px;"&gt;✔&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Numerical differentiation - finite differencing&amp;nbsp;&lt;span class="Apple-style-span" style="color: #333333; font-family: Times, 'Times New Roman', serif; line-height: 16px;"&gt;✔, &amp;nbsp;runge-kutta (and other ODE solvers)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Graphs&lt;/li&gt;
&lt;li&gt;Vectors ( 2, 3&amp;nbsp;&lt;span class="Apple-style-span" style="color: #333333; font-family: Times, 'Times New Roman', serif; line-height: 16px;"&gt;✔&lt;/span&gt;&amp;nbsp;and N dimensional)&lt;/li&gt;
&lt;li&gt;Geometry class &amp;amp; trigonometry solvers&lt;/li&gt;
&lt;li&gt;Probability&lt;/li&gt;
&lt;li&gt;Random numbers (Mersenne Twister, other PRNGs)&lt;/li&gt;
&lt;li&gt;Time and date&lt;/li&gt;
&lt;li&gt;Complex numbers&amp;nbsp;&lt;span class="Apple-style-span" style="color: #333333; font-family: Times, 'Times New Roman', serif; line-height: 16px;"&gt;✔&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Bitwise operators&amp;nbsp;&lt;span class="Apple-style-span" style="color: #333333; font-family: Times, 'Times New Roman', serif; line-height: 16px;"&gt;✔&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Mathematical constants&amp;nbsp;&lt;span class="Apple-style-span" style="color: #333333; font-family: Times, 'Times New Roman', serif; line-height: 16px;"&gt;✔&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Scientific constants&amp;nbsp;&lt;span class="Apple-style-span" style="color: #333333; font-family: Times, 'Times New Roman', serif; line-height: 16px;"&gt;✔&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;It would be great if you could let me know what kinds of maths utilities you would find useful, and even better if you have some of your own code and would like to collaborate with me on this.&lt;br /&gt;
&lt;br /&gt;
Update: Your suggestions:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Bezier curves (Cubic &amp;amp; Quadratic), Bezier surfaces?&lt;/li&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-258661825375016903?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/258661825375016903/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/08/experimentalized-maths-library.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/258661825375016903'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/258661825375016903'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/08/experimentalized-maths-library.html' title='Experimentalized Maths Library'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-4271099938555271900</id><published>2010-08-03T06:58:00.000-07:00</published><updated>2010-08-03T07:05:27.701-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='webcam'/><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='augmented reality'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><title type='text'>FLAR Toolkit - First Go</title><content type='html'>I thought I'd finally get round to having a go with the FLAR toolkit (an augmented reality toolkit for flash). I made a marker which will be used in any AR experiments I do on the site, then quickly made a test program. All I can say is it works quite nicely and I'll be playing around with it in the near future. Click the second image to run the test!&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_uea8fC_rl8A/TFgfqR7_y7I/AAAAAAAAAmU/GApxN2_JqY8/s320/FLAR_MARKER.jpg"&gt;&lt;/a&gt;&lt;a rel="prettyPhoto[flash]" href="http://experimentalized.com/experimentalized_blog/flsh/FLAR.swf?height=480&amp;amp;width=600" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_uea8fC_rl8A/TFggH-bTJfI/AAAAAAAAAmc/Ez85M5LCnmk/s320/Screen.png"&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="zemanta-pixie" style="margin-top:10px;height:15px"&gt;&lt;img class="zemanta-pixie-img" alt="" src="http://img.zemanta.com/pixy.gif?x-id=6e2c58cd-b8a0-4da5-9799-a65c40fd26e7" style="border:none;float:right"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-4271099938555271900?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/4271099938555271900/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/08/flar-toolkit-first-go.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/4271099938555271900'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/4271099938555271900'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/08/flar-toolkit-first-go.html' title='FLAR Toolkit - First Go'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_uea8fC_rl8A/TFgfqR7_y7I/AAAAAAAAAmU/GApxN2_JqY8/s72-c/FLAR_MARKER.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-3587828643227940103</id><published>2010-08-01T15:10:00.000-07:00</published><updated>2010-09-12T11:35:11.941-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='webcam'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='User Interface'/><title type='text'>Webcam Gestures in Flash</title><content type='html'>I'm currently creating a game which involves gesturing as the primary control method. For those who aren't familiar with the term gesturing, it was created to describe a set of motions carried out on a touch screen. I thought it would be pretty cool to make the keyboard and mouse completely obsolete and applied my gesturing algorithm to the webcam. Getting timings right with the webcam was the hardest part. You can choose when to start and stop using a mouse, but how do you tell when one gesture ends and the next begins on the webcam.&lt;br /&gt;
&lt;br /&gt;
Click below to watch a video of the experiment in action:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.youtube.com/watch?v=xHvK0vulox8" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_uea8fC_rl8A/TFXwqkpi7RI/AAAAAAAAAmM/SQBeCiKTbKs/s320/Screen.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
It works by calculating the angles travelled in a gesture. It compares these to a list of angles which relates to a certain gesture. For example for a straight line in the positive horizontal direction this would be 0-0-0-0-0 or in the negative horizontal 180-180-180-180. The program determines which preset gesture the carried out gesture is most like and then performs an action based on this choice. The result is by no means stable, but using a better set of thresholds and presets can improve the performance dramatically.&lt;br /&gt;
&lt;br /&gt;
Click &lt;a rel="prettyPhoto[flash]" href="http://experimentalized.com/experimentalized_blog/flsh/Gestures.swf?height=400&amp;width=550"&gt;here&lt;/a&gt; to launch the experiment and have a go yourself. Remember you'll need a webcam to do so.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-3587828643227940103?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/3587828643227940103/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/08/webcam-gestures-in-flash.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/3587828643227940103'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/3587828643227940103'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/08/webcam-gestures-in-flash.html' title='Webcam Gestures in Flash'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uea8fC_rl8A/TFXwqkpi7RI/AAAAAAAAAmM/SQBeCiKTbKs/s72-c/Screen.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-8934405454993001730</id><published>2010-07-27T09:44:00.000-07:00</published><updated>2010-07-27T09:44:06.333-07:00</updated><title type='text'>Computational Textual Analysis: Is it literature?</title><content type='html'>Is there a definitive definition for literature? I was thinking to myself about this the other day, and decided to find out. Before I set out on this experiment I'll make it clear that I think the answer is very subjective, and that although there are aspects found within most books that are considered true literature, these are not found within all of them. The initial list of books that I considered literature (with which to train my software) are widely spread in terms of theme, publication date and writing style, but the key point is they are chosen, therefore a concept of literature already exists in the person who chooses a list. The program I set out to write would be able to determine whether or not any piece of text was (or wasn't) literature by matching the similarity of various features of a piece of text, to this concept of true literature. It should also be noted that the program is language independent.&lt;br /&gt;
&lt;br /&gt;
I'll start by explaining briefly some of the characteristics that I decided to use in order to measure the level of literature in a piece of text:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Sentence length&lt;/li&gt;
&lt;li&gt;Average word length&lt;/li&gt;
&lt;li&gt;Unique words&lt;/li&gt;
&lt;li&gt;Vocabulary Score (unique words / total words)&lt;/li&gt;
&lt;li&gt;Vocabulary Deviation&lt;/li&gt;
&lt;li&gt;Character Deviation&lt;/li&gt;
&lt;li&gt;Word Entropy&lt;/li&gt;
&lt;li&gt;Character Entropy&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;Sentence length and word length were calculated by splitting the text into components with the splitting parameter for sentences being a full stop, and for words being a space. Note that words can therefore include punctuation; "this" classes as a different word to "this." when it is at the end of a sentence. This gives us some information about where words are used in sentences.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Unique words are simply words without repeats, for example in the text chunk "hi hi there there there", the unique words are "hi" and "there". These can be used to provide what I've called a vocabulary score. The vocabulary score essentially allows us to create a measure of the range of words used, that is (almost) independent of the length of the text. I say almost, because the range of vocabulary in the English language is limited, therefore as text chunks become longer (for example in a very long novel such as War and Peace) the vocabulary score will automatically decrease.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;The vocabulary and character deviation involve counting the number of repeats of each word and character - then calculating the standard deviation of this data set. The former is a good measure of how comfortable an author is using a wide range of words, as opposed to using them occasionally.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Finally two very important measures of "literaryness" are the entropy of words and characters. During initial experiments I found that these tend to stay fairly constant for the "literature" used for training. To calculate the entropy of a set the following calculation is used:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Entropy = - SUM [ Ki log2 ( Ki ) ],&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;where Ki is the probability of a member of the set (in this case a word or character) occurring.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;The next step of the experiment was to find a transform of the values of the above features that yielded very similar results for all of my training set.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;The following set of books were used in the training set:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Franz Kafka, &lt;i&gt;Metamorphosis&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;Oscar Wilde,&lt;i&gt; The Picture of Dorian Gray&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;Sir Arthur Conan Doyle, &lt;i&gt;The Hound of the Baskervilles&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;Joseph Conrad, &lt;i&gt;Heart of Darkness&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;Jules Verne, &lt;i&gt;Around the World in 80 Days&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;J.D. Salinger, &lt;i&gt;Catcher in the Rye&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;Anthony Burgess, &lt;i&gt;A Clockwork Orange&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;Bram Stoker, &lt;i&gt;Dracula&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;George Orwell, &lt;i&gt;Down and Out in Paris and London&lt;/i&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;And a value, which we'll call L was determined to be the smallest deviating transform of the textual features where:&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;L = (Word entropy + Character entropy - Word length) / Vocabulary score&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Other features were found to range too much between the works.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Given an average L value the distance away from the mean was used to give any test text a literature score. Unfortunately this blog did not receive the title of literature, but then nor did &lt;i&gt;Harry Potter and the Philosophers Stone&lt;/i&gt;, or &lt;i&gt;Twilight&lt;/i&gt;, or a Mills and Boon title, &lt;i&gt;A Fool For Love,&lt;/i&gt; so it seems to work quite nicely.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;A book I would consider to be literature, not on the training set was &lt;i&gt;Kidnapped&lt;/i&gt; by Robert Louis Stevenson, and it did indeed score highly on the literature front which means the system works!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Below is the application, just click to launch it and post a comment with any results you might find:&lt;/div&gt;&lt;div&gt;&lt;a rel="prettyPhoto[flash]" href="http://experimentalized.com/experimentalized_blog/flsh/FTA.swf?height=400&amp;width=550" imageanchor="1" style="clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="291" src="http://3.bp.blogspot.com/_uea8fC_rl8A/TE8IksrzKuI/AAAAAAAAAmE/YI6yT00cRys/s400/Untitled.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Currently the results are a bit spurious, mostly because thresholds are fiddly to get right, but with a bit of work and some other parameters I have been thinking about, this kind of textual analysis really might help us spot the next classics! The program currently works best with whole books, there are a load of free eBooks that are now in the public domain which you can test the software with!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-8934405454993001730?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/8934405454993001730/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/07/computational-textual-analysis-is-it.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/8934405454993001730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/8934405454993001730'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/07/computational-textual-analysis-is-it.html' title='Computational Textual Analysis: Is it literature?'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_uea8fC_rl8A/TE8IksrzKuI/AAAAAAAAAmE/YI6yT00cRys/s72-c/Untitled.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-1672604607868323781</id><published>2010-07-21T04:58:00.000-07:00</published><updated>2010-09-02T11:41:27.143-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Light'/><title type='text'>2D Dynamic Shadow Casting (and Lighting)</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: left;"&gt;After having a little think about how to do this effectively, the answer was actually rather simple (which ins't entirely in keeping with the rest of this blog). &amp;nbsp;My previous attempts involved raytracing the 2D scene. By stepping through every single point in the scene, and calculating the path to it from the light source a per pixel map of brightness can be generated. I decided however that this was far to CPU intensive for high complexity scenes so went down a simpler route. The basic algorithm was:&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Trace a path from the light source to each vertex in each shape,&lt;/li&gt;
&lt;li&gt;Continue these paths outwards from the shape, thus casting a shadow&lt;/li&gt;
&lt;li&gt;Generate polygons to be filled in the shadow colour with pairs of these paths&lt;/li&gt;
&lt;li&gt;Draw a light mask (just a circle with a transparency gradient over the floor)&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;Just click the first image to launch the experiment. I am quite pleased with the results!&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/DynamicLighting/2DShadow.swf?height=400&amp;amp;width=550" imageanchor="1" rel="prettyPhoto[flash]" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_uea8fC_rl8A/TEbeZYetmII/AAAAAAAAAls/UnxNQd7348A/s320/2D+dynamic.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_uea8fC_rl8A/TEbQb4JC8pI/AAAAAAAAAlk/xbKSYu9gyiI/s1600/2DShadow.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_uea8fC_rl8A/TEbQb4JC8pI/AAAAAAAAAlk/xbKSYu9gyiI/s320/2DShadow.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="" style="clear: both; text-align: left;"&gt;The image below shows the intermediary path tracing step:&lt;/div&gt;&lt;div class="" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/TEbf_YBF28I/AAAAAAAAAl8/um7oMVAovlQ/s1600/inter.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_uea8fC_rl8A/TEbf_YBF28I/AAAAAAAAAl8/um7oMVAovlQ/s320/inter.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;By changing the light source mask a directional torch like effect is simple to reproduce, again just click to launch the app:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/DynamicLighting/2DShadowTorch.swf?height=400&amp;amp;width=550" imageanchor="1" rel="prettyPhoto[flash]" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_uea8fC_rl8A/TEbfAuNmI5I/AAAAAAAAAl0/jjtvs4xmLDk/s320/2dtorch.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-1672604607868323781?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/1672604607868323781/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/07/2d-dynamic-shadow-casting.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/1672604607868323781'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/1672604607868323781'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/07/2d-dynamic-shadow-casting.html' title='2D Dynamic Shadow Casting (and Lighting)'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_uea8fC_rl8A/TEbeZYetmII/AAAAAAAAAls/UnxNQd7348A/s72-c/2D+dynamic.png' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-459888634425529163</id><published>2010-07-18T11:54:00.000-07:00</published><updated>2010-07-21T14:50:41.111-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='color detector'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='image encoding'/><title type='text'>Colour Palette Creator</title><content type='html'>I am sure that there are hundreds of tools like this on the web, but I thought it would be quite interesting to produce a colour palette based on an image. Imaging you are designing a website and you really like the colours used in a particular piece of art, then you've come to the right place. This software will extract the most common colours in an image, and also give you the average colour.&lt;br /&gt;
&lt;br /&gt;
The method used to calculate these is very simple. To calculate the average colour, simply sum all the RGB components of each pixel and divide by the total number of pixels. I do this using bitwise operators where:&lt;br /&gt;
&lt;br /&gt;
R = HEX &amp;gt;&amp;gt; 16 &amp;amp; 0xFF&lt;br /&gt;
G = HEX &amp;gt;&amp;gt; 8 &amp;amp; 0xFF&lt;br /&gt;
B = HEX &amp;amp; 0xFF&lt;br /&gt;
&lt;br /&gt;
and HEX = (R&amp;lt;&amp;lt;16 | G&amp;lt;&amp;lt;8 | B), useful stuff!&lt;br /&gt;
&lt;br /&gt;
To calculate the palette I create an accumulator array which counts the number of each colour in the image. Before using this I reduce the number of colours in the image using some simple math.&lt;br /&gt;
&lt;br /&gt;
I hope you find it quite interesting to have a play around with, just click the image to launch it. You can load your own images from your local computer to play around with it.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/ColorOccurance.swf?height=400&amp;amp;width=550" imageanchor="1" rel="prettyPhoto[flash]" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="233" src="http://2.bp.blogspot.com/_uea8fC_rl8A/TENNYJXY0QI/AAAAAAAAAlc/lyEOZWSlV4w/s320/Palette.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-459888634425529163?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/459888634425529163/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/07/colour-palette-creator.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/459888634425529163'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/459888634425529163'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/07/colour-palette-creator.html' title='Colour Palette Creator'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_uea8fC_rl8A/TENNYJXY0QI/AAAAAAAAAlc/lyEOZWSlV4w/s72-c/Palette.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-6070380847452132550</id><published>2010-07-17T16:36:00.000-07:00</published><updated>2010-07-17T16:37:23.989-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='webcam'/><category scheme='http://www.blogger.com/atom/ns#' term='shape recognition'/><category scheme='http://www.blogger.com/atom/ns#' term='augmented reality'/><category scheme='http://www.blogger.com/atom/ns#' term='face recognition'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><title type='text'>Real Time Feature Point Tracking in AS3</title><content type='html'>Its a bit late, so instead of posting a long informative post about how feature point tracking works I thought I'd just upload some of my results from this evening. I think its quite exciting stuff. The image shows feature point tracking working relatively well on my pupils, and also on other facial features (the last two images). I am very pleased with the result.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="640" src="http://3.bp.blogspot.com/_uea8fC_rl8A/TEI9XB8mcBI/AAAAAAAAAlM/nqVCs_FMtWY/s640/fpt.jpg" width="587" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;A related project I have also been working on this evening is optical flow which I am close to getting&amp;nbsp;&lt;/div&gt;&lt;div class="" style="clear: both; text-align: left;"&gt;working, here is a preview of what is to come:&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="232" src="http://4.bp.blogspot.com/_uea8fC_rl8A/TEI91ZDaIrI/AAAAAAAAAlU/JLwr056XfVU/s320/FlowField.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Both methods are used in tracking objects in moving images and have been implemented in real time. I will post sample movies and some explanations shortly so you can play around with them yourself.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-6070380847452132550?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/6070380847452132550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/07/real-time-feature-point-tracking-in-as3.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6070380847452132550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6070380847452132550'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/07/real-time-feature-point-tracking-in-as3.html' title='Real Time Feature Point Tracking in AS3'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_uea8fC_rl8A/TEI9XB8mcBI/AAAAAAAAAlM/nqVCs_FMtWY/s72-c/fpt.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-7129945405212740345</id><published>2010-07-13T13:38:00.000-07:00</published><updated>2010-07-13T13:44:23.250-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='image encoding'/><title type='text'>Computer Vision: Regional Differencing</title><content type='html'>I have always been very excited by the idea of computer vision. At the same time I find the concept of teaching a computer to sift through a grid of pixels, whilst gaining some sort of an insight into their meaning quite astounding. When we as humans look at a scene we can immediately identify objects of interest to us. We look at a boat and immediately can tell that it is a boat and not for example a chair. We can do this, even if we have never seen that particular boat before. Computers struggle with this kind of visual finesse, although there are examples (see&amp;nbsp;&lt;a href="http://science.howstuffworks.com/asimo3.htm"&gt;Assimo&lt;/a&gt;) that are already performing very well.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/TDzHVcT0d-I/AAAAAAAAAkk/AR5axPMSZPo/s1600/can3.jpg" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_uea8fC_rl8A/TDzHVcT0d-I/AAAAAAAAAkk/AR5axPMSZPo/s320/can3.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;Back to the point: I was looking at this situation and thought to myself that humans find it incredibly easy to establish important features in any image. Take for example the image to the left, we can see clearly the line where the water meets land at the far edge of the lake, we can see trees, we can see a ridge and its reflection, and we can see clouds. These geometries are made visible to use because of contrast and colour differences between regions in the image. I decided to think of a way for a computer to do this. I'm sure the method has been done before under a different name, but I couldn't find any material on it so I've decided to call the method "Regional Differencing".&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_uea8fC_rl8A/TDzLQmUIjyI/AAAAAAAAAks/QSXKivlJKIc/s1600/PIXIL.png" imageanchor="1" rel="prettyPhoto" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_uea8fC_rl8A/TDzLQmUIjyI/AAAAAAAAAks/QSXKivlJKIc/s320/PIXIL.png" /&gt;&lt;/a&gt;&lt;/div&gt;The method is fairly simple, but I am happy with the results. First the image is split into square regions of a constant size. The colour of these regions is equal to the average colour of the pixels contained within it. The result of this is a kind of pixilation as can be seen in the picture to the right. Now taking the colour values of every single pixel in the previous image, we can compare the value to that of the average regional colour.&lt;br /&gt;
&lt;br /&gt;
The result of this is quite interesting because areas that don't fit in with their surroundings are clearly distinguishable in the image. In this article I'd like to argue that this is part of the reason why humans are so good at picking out the geometries mentioned above. Humans can happily distinguish between different regions, even where differences are relatively subtle. Combining this ability with memory of collections of shapes, we can identify objects very successfully.&lt;br /&gt;
&lt;br /&gt;
So lets take a look at some of the results (as always click the first one to launch the application and try it out yourself):&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/RegionalDifferencing.swf?height=400&amp;amp;width=550" imageanchor="1" rel="prettyPhoto[flash]" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_uea8fC_rl8A/TDzNXiet2qI/AAAAAAAAAk0/LclbhuDDy_c/s320/1.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/TDzNcgqX71I/AAAAAAAAAk8/2Bh6R6603wo/s1600/2.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_uea8fC_rl8A/TDzNcgqX71I/AAAAAAAAAk8/2Bh6R6603wo/s320/2.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_uea8fC_rl8A/TDzNh3bsCzI/AAAAAAAAAlE/UaGh3f2FvJQ/s1600/3.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_uea8fC_rl8A/TDzNh3bsCzI/AAAAAAAAAlE/UaGh3f2FvJQ/s320/3.png" /&gt;&lt;/a&gt;&lt;/div&gt;The above 3 images show three different threshold levels for a constant pixel size, but if you run the app yourself you can also vary the pixel size yielding interesting results. At high thresholds it is interesting that the first objects that are made out are the trees and the line at the end of the lake, whereas the last objects made out are the clouds. Looking back I wonder if I found myself looking at these points before anything else.&lt;br /&gt;
&lt;br /&gt;
There are many other ways to produced these kinds of data, including the Sobel operator method shown in various previous posts but sometimes it is nice to take a new approach.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-7129945405212740345?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/7129945405212740345/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/07/computer-vision-regional-differencing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/7129945405212740345'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/7129945405212740345'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/07/computer-vision-regional-differencing.html' title='Computer Vision: Regional Differencing'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uea8fC_rl8A/TDzHVcT0d-I/AAAAAAAAAkk/AR5axPMSZPo/s72-c/can3.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-3694279808797470089</id><published>2010-07-12T08:05:00.000-07:00</published><updated>2010-07-12T12:23:51.707-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='image encoding'/><title type='text'>Regional Growth Segmentation: Superpixels</title><content type='html'>I recently came across some impressive software from some researchers at Stanford University (who else), called &lt;a href="http://make3d.cs.cornell.edu/"&gt;Make3D&lt;/a&gt; which takes any 2 dimensional images - preferably outdoor images, and converts them into 3D models. The whole 2D to 3D process begins with a method called image segmentation, where structures in an image are separated into superpixels. Superpixels are collections of pixels with similar properties - for example saturation, colour, brightness etc.&lt;br /&gt;
&lt;br /&gt;
I decided to write some software capable of creating the superpixel structure, and segmenting an image. The route I went down is called regional growth segmentation. Superpixels grow outwards from a sample pixel, and depending on the similarity of tested pixels to the superpixels, they are either added to the superpixel, or create new superpixels...&lt;br /&gt;
&lt;br /&gt;
Here are a few results with different thresholds for similarity (again, just click the first image to launch the application).&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/RGS.swf?height=400&amp;amp;width=550" imageanchor="1" rel="prettyPhoto[flash]" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_uea8fC_rl8A/TDst33YD5DI/AAAAAAAAAj8/RkKgNRTJ9tQ/s320/1.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_uea8fC_rl8A/TDst8EZwzTI/AAAAAAAAAkE/TnAqYcZNbYw/s1600/2.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_uea8fC_rl8A/TDst8EZwzTI/AAAAAAAAAkE/TnAqYcZNbYw/s320/2.png" /&gt;&lt;/a&gt;&lt;a href="http://1.bp.blogspot.com/_uea8fC_rl8A/TDsuAoSZ3pI/AAAAAAAAAkM/QDvqIEnsrF4/s1600/3.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_uea8fC_rl8A/TDsuAoSZ3pI/AAAAAAAAAkM/QDvqIEnsrF4/s320/3.png" /&gt;&lt;/a&gt;&lt;a href="http://1.bp.blogspot.com/_uea8fC_rl8A/TDsuEeB6VOI/AAAAAAAAAkU/r0xVGnSMBIU/s1600/4.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_uea8fC_rl8A/TDsuEeB6VOI/AAAAAAAAAkU/r0xVGnSMBIU/s320/4.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
I'll take a look at some of the Make3D source code to see if I can generate some 3D planes from my superpixel, so stay tuned!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-3694279808797470089?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/3694279808797470089/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/07/regional-growth-segmentation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/3694279808797470089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/3694279808797470089'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/07/regional-growth-segmentation.html' title='Regional Growth Segmentation: Superpixels'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uea8fC_rl8A/TDst33YD5DI/AAAAAAAAAj8/RkKgNRTJ9tQ/s72-c/1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-8110097610403683798</id><published>2010-07-11T09:58:00.000-07:00</published><updated>2010-07-15T02:47:06.454-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Light'/><title type='text'>Generating Normal Maps: 2D Images</title><content type='html'>The normal map used in the previous post was generated from a 3D model, so calculating normals was quite trivial. Taking any two dimensional image and calculating accurate realistic normals on the other hand is not. I have used a simple method using Sobel operators which seems to work quite well.&lt;br /&gt;
&lt;br /&gt;
&lt;a rel="prettyPhoto" href="http://1.bp.blogspot.com/_uea8fC_rl8A/TDn0kgwzePI/AAAAAAAAAjU/wOWH8-V5rGA/s1600/Normal.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="267" src="http://1.bp.blogspot.com/_uea8fC_rl8A/TDn0kgwzePI/AAAAAAAAAjU/wOWH8-V5rGA/s400/Normal.png" width="400" /&gt;&lt;/a&gt;The Sobel operator provides X or Y gradient information about a certain image. Lets take a look at an example (Picture courtesy of my lovely girlfriend Camilla). The picture below shows a 2D image, with no 3D data whatsoever.&lt;br /&gt;
&lt;br /&gt;
The sobel operator works by calculating the gradient of an image based on a range of pixels surrounding the pixel being tested.&lt;br /&gt;
&lt;br /&gt;
First the image must be turned into a greyscale image, so that only brightness values are taken into account. Then a sobal operator is applied in the vertical and horizontal direction.&lt;br /&gt;
&lt;br /&gt;
&lt;a rel="prettyPhoto" href="http://2.bp.blogspot.com/_uea8fC_rl8A/TDn1Y_FTtDI/AAAAAAAAAjk/DUf3or8CUiY/s1600/Vert.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_uea8fC_rl8A/TDn1Y_FTtDI/AAAAAAAAAjk/DUf3or8CUiY/s320/Vert.png" /&gt;&lt;/a&gt;&lt;a rel="prettyPhoto" href="http://3.bp.blogspot.com/_uea8fC_rl8A/TDn1UGpXy2I/AAAAAAAAAjc/vDNHcWjVnBg/s1600/Hor.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_uea8fC_rl8A/TDn1UGpXy2I/AAAAAAAAAjc/vDNHcWjVnBg/s320/Hor.png" /&gt;&lt;/a&gt;The results of applying the sobel operators can be seen in these two images. With the horizontal and vertical sobel operators respectively. These images correspond to the red and green channels in the final image. Since we have no sensible way of calculating a bump map for the two dimensional image the blue channel will just be set to a maximum throughout the image.&lt;br /&gt;
&lt;br /&gt;
Finally we can apply this to the &lt;a href="http://experimentalized.blogspot.com/2010/07/2d-deferred-normal-lighting.html"&gt;2D Deferred Normal Lighting&lt;/a&gt; simulation I wrote about in the last post. The effects are quite impressive, creating a distinctly 3D look from a 2D image (Just click the image to launch the application):&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a rel="prettyPhoto[flash]" href="http://experimentalized.com/experimentalized_blog/flsh/DynamicLighting/DynamicNormal_Camilla.swf?height=400&amp;width=300" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_uea8fC_rl8A/TDn2nCsGWtI/AAAAAAAAAjs/S8bbm-BKq_4/s320/Screen.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
To expand on this slightly further I thought it would be interesting to apply this to a webcam stream. This meant calculating a normal map every frame on top of the per pixel lighting so the resulting application is quite CPU intensive. I'm not quite as pleased with the effects as previously as there seems to be a lot of noise in the image. It might work better for you guys, just click the next image to launch it:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a rel="prettyPhoto[flash]" href="http://experimentalized.com/experimentalized_blog/flsh/DynamicLighting/Normal_Webcam_Lighting.swf?height=320&amp;width=440" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="145" src="http://1.bp.blogspot.com/_uea8fC_rl8A/TDn3KuT355I/AAAAAAAAAj0/yf-E0FSB8dQ/s200/WEBCAM.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-8110097610403683798?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/8110097610403683798/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/07/generating-normal-maps-2d-images.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/8110097610403683798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/8110097610403683798'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/07/generating-normal-maps-2d-images.html' title='Generating Normal Maps: 2D Images'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_uea8fC_rl8A/TDn0kgwzePI/AAAAAAAAAjU/wOWH8-V5rGA/s72-c/Normal.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-6067248106281398712</id><published>2010-07-11T07:41:00.000-07:00</published><updated>2010-07-12T14:36:29.417-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Light'/><title type='text'>2D Deferred Normal Lighting</title><content type='html'>Continuing on the same lines as my previous post I thought I would create a few more 2 dimensional lighting simulations. With a little help from a post on normal mapping from a post on &lt;a href="http://planetpixelemporium.com/tutorialpages/normal3.html"&gt;Planet Pixel Emporium&lt;/a&gt;&amp;nbsp;I was able to create some real time 2D deferred normal lighting using actionscript. The simulation works on a per pixel basis so for large images the method would get very slow.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/DynamicLighting/DynamicNormal.swf?height=512&amp;amp;width=512" imageanchor="1" rel="prettyPhoto[flash]" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://2.bp.blogspot.com/_uea8fC_rl8A/TDnUQlzs2yI/AAAAAAAAAi8/YPMGAv7WLzY/s200/Screen.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/TDnVDZ2avFI/AAAAAAAAAjM/2d3xH9BLGFk/s1600/face.jpg" imageanchor="1" rel="prettyPhoto" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" height="200" src="http://3.bp.blogspot.com/_uea8fC_rl8A/TDnVDZ2avFI/AAAAAAAAAjM/2d3xH9BLGFk/s200/face.jpg" width="200" /&gt;&lt;/a&gt;First lets take a look at the final result and then I will explain how it works. Click the image to the left to start up the application. You'll notice that moving your mouse around over the image moves the light source. Not only does this change information about how far the light should spread, but also the direction of the light with respect to every pixel on the screen.&lt;br /&gt;
&lt;br /&gt;
This allows images to be rendered with a far more realistic depth and 3D feel (compare it to the original image on the right). For this reason the method is &amp;nbsp;used in many modern computer games.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/TDnVA9bJb5I/AAAAAAAAAjE/xoGY26ssxUA/s1600/face_norm.jpg" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://4.bp.blogspot.com/_uea8fC_rl8A/TDnVA9bJb5I/AAAAAAAAAjE/xoGY26ssxUA/s200/face_norm.jpg" width="200" /&gt;&lt;/a&gt;The effect is created using a normal map. A normal map is a way of encoding data about the orientation of a plane using RGB colour. The red channel in the image represents the horizontal gradient of a face, the blue channel represents the vertical gradient, and the blue channel represents the height data (a bump map). The image below shows the normal map used for the image. I created the application by calculating the dot product of the normal at each point in the image with the light vector shining onto that pixel from the mouse's location.&lt;br /&gt;
&lt;br /&gt;
The greater the dot product the more direct the light shining onto a point. In addition to this a distance falloff is used for the light to create the torch-like effect. I just use a factor of one over the square root of the distance as my falloff.&lt;br /&gt;
&lt;br /&gt;
Obviously what isn't being considered in this is shadow casting so it isn't quite a real ray trace, but using bump map information it would be possible to create a real time semi 2-d ray trace.&lt;br /&gt;
&lt;br /&gt;
Just for fun here is another sample, just click to launch it:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a rel="prettyPhoto[flash]" href="http://experimentalized.com/experimentalized_blog/flsh/DynamicLighting/DynamicNormal2.swf?width=400&amp;amp;height=308" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_uea8fC_rl8A/TDuKQg7eKCI/AAAAAAAAAkc/6fjBUk7vhgw/s320/screen.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-6067248106281398712?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/6067248106281398712/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/07/2d-deferred-normal-lighting.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6067248106281398712'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6067248106281398712'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/07/2d-deferred-normal-lighting.html' title='2D Deferred Normal Lighting'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_uea8fC_rl8A/TDnUQlzs2yI/AAAAAAAAAi8/YPMGAv7WLzY/s72-c/Screen.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-1379239915453333818</id><published>2010-07-09T04:04:00.000-07:00</published><updated>2010-07-09T04:06:11.007-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='procedural generation'/><category scheme='http://www.blogger.com/atom/ns#' term='Light'/><category scheme='http://www.blogger.com/atom/ns#' term='Physics'/><title type='text'>2D Dynamic Lighting - well almost</title><content type='html'>I had a nice idea to create a 2D dynamic lighting experiment, where various light sources could be moved round and cast shadows in real time. I got started on the experiment and created a class to hold a coloured light source and then I got a little too excited by some of the pretty generative artwork I was making and decided to change the purpose of the experiment. I'll briefly explain how the light sources work. A light source is made up of a point, a colour and a falloff rate. By measuring the distance from each light source in an image, and summing the light values at those points it is simple to calculate the light intensity at each point in the image. Here are some results (just click to run the app):&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/DynamicLighting/Dynamic2D.swf?height=400&amp;amp;width=550" imageanchor="1" rel="prettyPhoto[flash]" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="466" src="http://4.bp.blogspot.com/_uea8fC_rl8A/TDcAP8Y_UZI/AAAAAAAAAiM/c_Pik53giFA/s640/screen.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Some of the effects remind me of binary star systems. Here are 2 more apps showing real time moving light sources with various effects:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/DynamicLighting/Dynamic2DMovingInvert.swf?height=400&amp;amp;width=550" imageanchor="1" rel="prettyPhoto[flash]" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_uea8fC_rl8A/TDcBwpP-G4I/AAAAAAAAAis/rCxy2WPyEWc/s320/s1.png" /&gt;&lt;/a&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/DynamicLighting/Dynamic2DMoving.swf?height=400&amp;amp;width=550" imageanchor="1" rel="prettyPhoto[flash]" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_uea8fC_rl8A/TDcBuE8LMgI/AAAAAAAAAik/hF3I-hqfrqQ/s320/s0.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-1379239915453333818?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/1379239915453333818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/07/2d-dynamic-lighting-well-almost.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/1379239915453333818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/1379239915453333818'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/07/2d-dynamic-lighting-well-almost.html' title='2D Dynamic Lighting - well almost'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uea8fC_rl8A/TDcAP8Y_UZI/AAAAAAAAAiM/c_Pik53giFA/s72-c/screen.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-235076448332794949</id><published>2010-07-07T10:04:00.000-07:00</published><updated>2010-07-07T10:18:54.013-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fractal'/><category scheme='http://www.blogger.com/atom/ns#' term='mathematics'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='procedural generation'/><title type='text'>Circle Packing - brute force approach</title><content type='html'>Earlier this year, as part of my degree, I carried out a project that involved measuring the &lt;a href="http://en.wikipedia.org/wiki/Fractal_dimension"&gt;f&lt;span id="goog_1792288527"&gt;&lt;/span&gt;ractal dimension&lt;/a&gt;&lt;span id="goog_1792288528"&gt;&lt;/span&gt;, and packing densities of various systems. I thought I'd have a play around with something along similar lines, circle packing.&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;There are many subtle and interesting and above all intelligent ways of packing circles into spaces, but this is not one of them. I decided to take a brute force approach. This is the structure my algorithm took:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Pick a random point, if it is within any circles that already exist find a new point&lt;/li&gt;
&lt;li&gt;Increase the radius of that point until it overlaps with either the edge of the scene, or another circle on the scene.&lt;/li&gt;
&lt;li&gt;Draw the circle&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;This is as far as I can tell, both the simplest approach and the slowest. Lets take a look at the results, click the image to run the application. An interesting idea is to draw a line between each circle when they collide. This forms a kind of node based structure between circles, creating a network where larger circles hold more power in the network. I wonder if you could create a &lt;a href="http://en.wikipedia.org/wiki/PageRank"&gt;page ranking&lt;/a&gt; system based on something like this...?&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/Circle_Packing_2.swf?height=400&amp;amp;width=550" imageanchor="1" rel="prettyPhoto[flash]" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="640" src="http://4.bp.blogspot.com/_uea8fC_rl8A/TDS08YmIJ2I/AAAAAAAAAiE/12ycMLvjvFc/s640/screen.jpg" width="588" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-235076448332794949?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/235076448332794949/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/07/circle-packing-brute-force-approach.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/235076448332794949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/235076448332794949'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/07/circle-packing-brute-force-approach.html' title='Circle Packing - brute force approach'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uea8fC_rl8A/TDS08YmIJ2I/AAAAAAAAAiE/12ycMLvjvFc/s72-c/screen.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-5912787287407457900</id><published>2010-07-06T15:07:00.001-07:00</published><updated>2010-07-07T02:40:31.259-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fractal'/><category scheme='http://www.blogger.com/atom/ns#' term='mathematics'/><category scheme='http://www.blogger.com/atom/ns#' term='Mandelbrot'/><category scheme='http://www.blogger.com/atom/ns#' term='Julia Set'/><title type='text'>Benoit Mandelbrot - Fractals and the art of roughness</title><content type='html'>A personal hero of mine talks about fractals.&lt;br /&gt;
&lt;br /&gt;
&lt;object height="326" width="446"&gt;&lt;param name="movie" value="http://video.ted.com/assets/player/swf/EmbedPlayer.swf"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true" /&gt;&lt;param name="allowScriptAccess" value="always"/&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;param name="bgColor" value="#ffffff"&gt;&lt;/param&gt;&lt;param name="flashvars" value="vu=http://video.ted.com/talks/dynamic/BenoitMandelbrot_2010-medium.flv&amp;su=http://images.ted.com/images/ted/tedindex/embed-posters/BenoitMandelbrot-2010.embed_thumbnail.jpg&amp;vw=432&amp;vh=240&amp;ap=0&amp;ti=909&amp;introDuration=15330&amp;adDuration=4000&amp;postAdDuration=830&amp;adKeys=talk=benoit_mandelbrot_fractals_the_art_of_roughness;year=2010;theme=numbers_at_play;event=TED2010;&amp;preAdTag=tconf.ted/embed;tile=1;sz=512x288;" /&gt;&lt;embed src="http://video.ted.com/assets/player/swf/EmbedPlayer.swf" pluginspace="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" bgColor="#ffffff" width="446" height="326" allowFullScreen="true" allowScriptAccess="always" flashvars="vu=http://video.ted.com/talks/dynamic/BenoitMandelbrot_2010-medium.flv&amp;su=http://images.ted.com/images/ted/tedindex/embed-posters/BenoitMandelbrot-2010.embed_thumbnail.jpg&amp;vw=432&amp;vh=240&amp;ap=0&amp;ti=909&amp;introDuration=15330&amp;adDuration=4000&amp;postAdDuration=830&amp;adKeys=talk=benoit_mandelbrot_fractals_the_art_of_roughness;year=2010;theme=numbers_at_play;event=TED2010;"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;
&lt;br /&gt;
I enjoyed his quote at the end and found it quite relevant to a lot of the work I do on this blog:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;"Bottomless wonders spring from simple rules... repeated without end"&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-5912787287407457900?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/5912787287407457900/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/07/benoit-mandelbrot-fractals-and-art-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/5912787287407457900'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/5912787287407457900'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/07/benoit-mandelbrot-fractals-and-art-of.html' title='Benoit Mandelbrot - Fractals and the art of roughness'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-6013783981449686018</id><published>2010-07-02T03:35:00.000-07:00</published><updated>2010-07-07T02:41:13.702-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='webcam'/><category scheme='http://www.blogger.com/atom/ns#' term='shape recognition'/><category scheme='http://www.blogger.com/atom/ns#' term='mathematics'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><title type='text'>Computer Vision and the Hough Transform</title><content type='html'>I was working on computer vision yesterday and went to my girlfriend's graduation ceremony today so haven't had a chance to upload. I decided to take another look at computer vision - and in this case a slightly more intelligent one than previously. The method I took a look at is known as the Hough transform. I think that the simplest and most effective way to explain how the Hough Transform works is using a bullet pointed list, but before I begin you should know that it is used to extract information about shape features from an image. In this case a line / all the lines present in an image.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;We start with an image in which we want to detect lines:&lt;/li&gt;
&lt;/ul&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/TC2-RzK1vGI/AAAAAAAAAgc/ksh0FSXBDss/s1600/Hough+Shape.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="145" src="http://4.bp.blogspot.com/_uea8fC_rl8A/TC2-RzK1vGI/AAAAAAAAAgc/ksh0FSXBDss/s200/Hough+Shape.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ul&gt;&lt;li&gt;First of all apply a Canny Line Detector to the image isolating edge pixels:&lt;/li&gt;
&lt;/ul&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/TC2-WgGuOOI/AAAAAAAAAgk/NWiQAoi10rY/s1600/Canny+Line.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="145" src="http://4.bp.blogspot.com/_uea8fC_rl8A/TC2-WgGuOOI/AAAAAAAAAgk/NWiQAoi10rY/s200/Canny+Line.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;At this stage, to reduce computation required in the next stage I decided to sample edge pixels instead of using all of them. The results for s=0.2 and s=0.9 are shown below:&lt;/li&gt;
&lt;/ul&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/TC2_j3rlnII/AAAAAAAAAgs/9IQRfs6iCLU/s1600/Sample+Line+20.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="145" src="http://4.bp.blogspot.com/_uea8fC_rl8A/TC2_j3rlnII/AAAAAAAAAgs/9IQRfs6iCLU/s200/Sample+Line+20.png" width="200" /&gt;&lt;/a&gt;&lt;a href="http://2.bp.blogspot.com/_uea8fC_rl8A/TC2_p2T_c0I/AAAAAAAAAg0/oyHN7x0FOVE/s1600/Sample+Line+90.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="145" src="http://2.bp.blogspot.com/_uea8fC_rl8A/TC2_p2T_c0I/AAAAAAAAAg0/oyHN7x0FOVE/s200/Sample+Line+90.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Then, for every possible pair of sampled edge pixels, calculate the angle of the line between it, as well as the distance to the origin. Plot a cumulative bitmap graph of angle against distance. The way I did this was to increase the pixel value in that location each time a distance/angle occurred. Recall that a line can be defined by an angle and distance to an origin. The resulting bitmap is known as the Hough Transform:&lt;/li&gt;
&lt;/ul&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_uea8fC_rl8A/TC2_w6aWnwI/AAAAAAAAAg8/i4PJt_zqExs/s1600/Hough+Transform.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="145" src="http://1.bp.blogspot.com/_uea8fC_rl8A/TC2_w6aWnwI/AAAAAAAAAg8/i4PJt_zqExs/s200/Hough+Transform.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ul&gt;&lt;li&gt;By increasing contrast and playing around with thresholds in the Hough transform it is clear that 8 distinct regions are visible, we know that the detector has done its job as there are 8 lines in the original image:&lt;/li&gt;
&lt;/ul&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/TC2_-9bNzuI/AAAAAAAAAhE/p6smGRvCl_I/s1600/Hough+Transform+-+HC.jpg" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="145" src="http://4.bp.blogspot.com/_uea8fC_rl8A/TC2_-9bNzuI/AAAAAAAAAhE/p6smGRvCl_I/s200/Hough+Transform+-+HC.jpg" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Remember that each point provides us with data about the line angle and distance from the origin, so lets use the flash API to draw some lines:&lt;/li&gt;
&lt;/ul&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/TC3AZJKjL7I/AAAAAAAAAhM/h8VL2vvFmfs/s1600/Line_Detection.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="145" src="http://3.bp.blogspot.com/_uea8fC_rl8A/TC3AZJKjL7I/AAAAAAAAAhM/h8VL2vvFmfs/s200/Line_Detection.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;ul&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;As you can see the result isn't too bad at all, we get 8 lines, although they are a bit diffuse. The next step is to look into grouping algorithms to only pick single pixel points from the final hough transforms for each lines. In this version of the program a line is drawn for each pixel, which results in an angle and position range for each line. Pretty close though.&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;So thats how a Hough transform works for line detection. Just for fun, heres a real time hough transform on a webcam stream. Just click the image below to launch it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/HoughTransformWebcam.swf?height=400&amp;amp;width=550" imageanchor="1" rel="prettyPhoto[flash]" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="232" src="http://1.bp.blogspot.com/_uea8fC_rl8A/TC0SeB-dQQI/AAAAAAAAAgU/FOjl7XzZ5dY/s320/H1.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-6013783981449686018?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/6013783981449686018/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/07/computer-vision-and-hough-transform.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6013783981449686018'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6013783981449686018'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/07/computer-vision-and-hough-transform.html' title='Computer Vision and the Hough Transform'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uea8fC_rl8A/TC2-RzK1vGI/AAAAAAAAAgc/ksh0FSXBDss/s72-c/Hough+Shape.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-6964095571765673704</id><published>2010-06-30T08:39:00.000-07:00</published><updated>2010-07-07T02:41:45.251-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Emergence'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='procedural generation'/><title type='text'>Generative Art</title><content type='html'>Just thought I'd have a quick look at creating some generative art after reading Karl Simms' paper on &lt;a href="http://www.karlsims.com/papers/siggraph91.html"&gt;Artificial Evolution for Computer Graphics&lt;/a&gt;. Images are created by randomly acting various functions on a bitmap in some predetermined order. Functions might include gradients, convolution filters, shapes amongst others. At this stage I have only made a black and white version of the generator, but I'll look what I can do about a colour one sometime soon. Just click the first images to launch the app, click and click again to stop/start the generator. If you find some cool images just take a screenshot and email them to me.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/Generative_Art_2.swf?height=400&amp;amp;width=550" imageanchor="1" rel="prettyPhoto[flash]" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="291" src="http://1.bp.blogspot.com/_uea8fC_rl8A/TCtj-ov1sLI/AAAAAAAAAfs/KU2vwUapnfw/s400/1.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_uea8fC_rl8A/TCtkDGOMeRI/AAAAAAAAAf8/63iMMgw9_Og/s1600/3.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="291" src="http://2.bp.blogspot.com/_uea8fC_rl8A/TCtkDGOMeRI/AAAAAAAAAf8/63iMMgw9_Og/s400/3.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/TCtkBqzI-oI/AAAAAAAAAf0/oPT4o45bbR4/s1600/2.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="292" src="http://4.bp.blogspot.com/_uea8fC_rl8A/TCtkBqzI-oI/AAAAAAAAAf0/oPT4o45bbR4/s400/2.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/TCtkI_8ff_I/AAAAAAAAAgE/5cw80ssVJ5U/s1600/4.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="292" src="http://4.bp.blogspot.com/_uea8fC_rl8A/TCtkI_8ff_I/AAAAAAAAAgE/5cw80ssVJ5U/s400/4.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/TCtkNTK0XyI/AAAAAAAAAgM/V9at9XOZYnQ/s1600/5.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="290" src="http://3.bp.blogspot.com/_uea8fC_rl8A/TCtkNTK0XyI/AAAAAAAAAgM/V9at9XOZYnQ/s400/5.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-6964095571765673704?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/6964095571765673704/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/06/generative-art.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6964095571765673704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6964095571765673704'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/06/generative-art.html' title='Generative Art'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_uea8fC_rl8A/TCtj-ov1sLI/AAAAAAAAAfs/KU2vwUapnfw/s72-c/1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-2436336776003838938</id><published>2010-06-28T13:50:00.000-07:00</published><updated>2010-07-07T02:58:08.923-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Genetic Algorithms'/><category scheme='http://www.blogger.com/atom/ns#' term='Physics'/><title type='text'>Physics Evolution: Step 1</title><content type='html'>After a bit of a post exam break I'm back to my desk and playing around with some projects that I've had to let lie for some reason or another over the last few months. The first one I thought I'd look at again was the &lt;a href="http://experimentalized.blogspot.com/2010/03/creature-evolution-in-flash-first.html"&gt;Creature Evolution in Flash&lt;/a&gt;&amp;nbsp;article I wrote a few months ago. Back then the idea was to write a program that would evolve creatures using genetic algorithms. Today I've been working on the first step namely creating a world within which these creatures should be able to evolve. This requires a physics engine and instead of writing my own from scratch, or using something I've made before I decided to go with an efficient, fast, and reliable engine, APE, by Alec Cove. You can download the API &lt;a href="http://www.cove.org/ape/"&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
So I've been getting to grips with the engine which seems fairly simple to use and here is a little demo:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/APE.swf?height=400&amp;amp;width=550" imageanchor="1" rel="prettyPhoto[flash]" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_uea8fC_rl8A/TCkK2SBkFSI/AAAAAAAAAfk/XOf9OLzFy9I/s320/screen.png" /&gt;&lt;/a&gt;&lt;/div&gt;So what is next? The idea behind genetic algorithms is that some genotype, in this case a string of 1's and 0's, determines a phenotype, in this case the structure of a creature. By randomly mutating bits in the genetic code, and testing the resulting creatures against one another, and sticking with the code that yields the best results, creatures can be made to evolve. Creatures can for example be tested for their ability to run fast, or for their ability to jump, or to swim.&lt;br /&gt;
&lt;br /&gt;
Ideally I will reach a stage where code can be saved at any stage of the process, and can be emailed to another person somewhere else in the world who can continue to evolve the same creature. Obviously since evolution is random there could be some very interesting splits. It would be nice to create a sandpit where creatures could be watched. A further investigation would be the effect of mating genotypes to create hybrid creatures, and obviously the nature of the algorithm used to produce creature structure would determine the success of this.&lt;br /&gt;
&lt;br /&gt;
Anyway stay tuned for progress!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-2436336776003838938?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/2436336776003838938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/06/physics-evolution-step-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/2436336776003838938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/2436336776003838938'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/06/physics-evolution-step-1.html' title='Physics Evolution: Step 1'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_uea8fC_rl8A/TCkK2SBkFSI/AAAAAAAAAfk/XOf9OLzFy9I/s72-c/screen.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-6330490414154183727</id><published>2010-06-22T02:13:00.000-07:00</published><updated>2010-07-07T02:57:39.031-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fractal'/><category scheme='http://www.blogger.com/atom/ns#' term='Cellular Automata'/><category scheme='http://www.blogger.com/atom/ns#' term='mathematics'/><category scheme='http://www.blogger.com/atom/ns#' term='procedural generation'/><title type='text'>Von Neumann Cellular Automata</title><content type='html'>I just saw the TED talk from Stephen Wolfram below and noticed I'd never written any 1D cellular automata. He briefly mentions rule 30 and the emergence of complexity from a simple set of rules. The Von Neumann automata is very simple to write. Given a single cell, the state of the new cell (either on or off) is determined by the cells in its local neighbourhood. In one dimension this means the state of itself, the cell just to its left, and the cell just to its right. This means there are 8 possible states for local neighbourhoods (8 rules) and therefore 256 possible outcomes of the system.&lt;br /&gt;
&lt;br /&gt;
&lt;object height="326" width="446"&gt;&lt;param name="movie" value="http://video.ted.com/assets/player/swf/EmbedPlayer.swf"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true" /&gt;&lt;param name="allowScriptAccess" value="always"/&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;param name="bgColor" value="#ffffff"&gt;&lt;/param&gt;&lt;param name="flashvars" value="vu=http://video.ted.com/talks/dynamic/StephenWolfram_2010-medium.flv&amp;su=http://images.ted.com/images/ted/tedindex/embed-posters/StephenWolfram-2010.embed_thumbnail.jpg&amp;vw=432&amp;vh=240&amp;ap=0&amp;ti=843&amp;introDuration=15330&amp;adDuration=4000&amp;postAdDuration=830&amp;adKeys=talk=stephen_wolfram_computing_a_theory_of_everything;year=2010;theme=new_on_ted_com;theme=what_s_next_in_tech;theme=unconventional_explanations;theme=bold_predictions_stern_warnings;theme=inspired_by_nature;theme=tales_of_invention;theme=art_unusual;theme=numbers_at_play;event=TED2010;&amp;preAdTag=tconf.ted/embed;tile=1;sz=512x288;" /&gt;&lt;embed src="http://video.ted.com/assets/player/swf/EmbedPlayer.swf" pluginspace="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" bgColor="#ffffff" width="446" height="326" allowFullScreen="true" allowScriptAccess="always" flashvars="vu=http://video.ted.com/talks/dynamic/StephenWolfram_2010-medium.flv&amp;su=http://images.ted.com/images/ted/tedindex/embed-posters/StephenWolfram-2010.embed_thumbnail.jpg&amp;vw=432&amp;vh=240&amp;ap=0&amp;ti=843&amp;introDuration=15330&amp;adDuration=4000&amp;postAdDuration=830&amp;adKeys=talk=stephen_wolfram_computing_a_theory_of_everything;year=2010;theme=new_on_ted_com;theme=what_s_next_in_tech;theme=unconventional_explanations;theme=bold_predictions_stern_warnings;theme=inspired_by_nature;theme=tales_of_invention;theme=art_unusual;theme=numbers_at_play;event=TED2010;"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;
&lt;br /&gt;
As Mr Wolfram mentions in the talk, most of the outcomes are not particularly interesting, some are very plain and some are quite pretty. Below is rule 26, it looks nice but beyond that it is quite a simple rule. Self repetition on a number of different scales is pretty much all it is capable of. Just click the image to launch it.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/Rule26.swf?height=400&amp;amp;width=550" imageanchor="1" rel="prettyPhoto[flash]" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="472" src="http://2.bp.blogspot.com/_uea8fC_rl8A/TCB-HSpOIGI/AAAAAAAAAfM/X-eQY7JtO7U/s640/26.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
The next two examples are rule 30 and rule 110 respectively. These are extremely interesting. Rule 30 displays what Wolfram calls "Class 3" behaviour, which is a chaotic and seemingly random, whereas Rule 110 displays "Class 4" behaviour, which is neither completely random nor completely repetitive. The interaction of various local structures is used to prove Universality. Again just click the images to launch the programs!&lt;br /&gt;
&lt;br /&gt;
Rule 30 can be used as an excellent random generator:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/Rule30.swf?height=400&amp;amp;width=550" imageanchor="1" rel="prettyPhoto[flash]" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="464" src="http://3.bp.blogspot.com/_uea8fC_rl8A/TCB-OAYEgwI/AAAAAAAAAfU/4aPiKQtiLfg/s640/30.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Notice the life-like region travelling up near the centre in Rule 110:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/Rule110.swf?height=400&amp;amp;width=550" imageanchor="1" rel="prettyPhoto[flash]" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="484" src="http://1.bp.blogspot.com/_uea8fC_rl8A/TCB-R58H5cI/AAAAAAAAAfc/REcOKaIi9VU/s640/110.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-6330490414154183727?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/6330490414154183727/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/06/von-neumann-cellular-automata.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6330490414154183727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6330490414154183727'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/06/von-neumann-cellular-automata.html' title='Von Neumann Cellular Automata'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_uea8fC_rl8A/TCB-HSpOIGI/AAAAAAAAAfM/X-eQY7JtO7U/s72-c/26.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-2217409442034996765</id><published>2010-05-31T05:37:00.000-07:00</published><updated>2010-07-07T02:56:52.154-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='Particles'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Physics'/><title type='text'>Galaxy</title><content type='html'>Just a little fun one because I've finished my exams and I haven't had time to start any big projects yet. A bit of very simple inverse square law gravitational physics to simulate the sombrero galaxy. All orbiting stars are attracted to the centre of the galaxy by an amount proportional to 1 over the square root of the distance between them.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/TAOs3ZaR2QI/AAAAAAAAAec/qza0Zae5-sE/s1600/sombrero_galaxy.jpg" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="355" src="http://4.bp.blogspot.com/_uea8fC_rl8A/TAOs3ZaR2QI/AAAAAAAAAec/qza0Zae5-sE/s640/sombrero_galaxy.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Just click the two images below to launch the 2D and 3D simulations! Enjoy.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/orbit2.swf?height=400&amp;amp;width=400" imageanchor="1" rel="prettyPhoto[flash]" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="161" src="http://1.bp.blogspot.com/_uea8fC_rl8A/TAOtCnzFMFI/AAAAAAAAAes/PeOokvVewOo/s200/screen2.png" width="200" /&gt;&lt;/a&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/orbit.swf?height=400&amp;amp;width=400" imageanchor="1" rel="prettyPhoto[flash]" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="198" src="http://1.bp.blogspot.com/_uea8fC_rl8A/TAOs9oodI7I/AAAAAAAAAek/QHbtdkvnmts/s200/screen1.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The three examples below show that with slightly different initial conditions, the shapes we find in a simple galactic simulation like this one, are actually surprisingly similar to those we see in real galaxies, for example in the first you can almost see the emergence of the spiral arms of our own galaxy the Milky Way.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_uea8fC_rl8A/TAOvzSN-guI/AAAAAAAAAe0/r6Pf7m0l2fk/s1600/s1.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_uea8fC_rl8A/TAOvzSN-guI/AAAAAAAAAe0/r6Pf7m0l2fk/s320/s1.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/TAOv3Do2hYI/AAAAAAAAAe8/hI7B-RswxYg/s1600/s2.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_uea8fC_rl8A/TAOv3Do2hYI/AAAAAAAAAe8/hI7B-RswxYg/s320/s2.png" /&gt;&lt;/a&gt;&lt;a href="http://2.bp.blogspot.com/_uea8fC_rl8A/TAOv6qKuauI/AAAAAAAAAfE/isGTBQChQ84/s1600/s3.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_uea8fC_rl8A/TAOv6qKuauI/AAAAAAAAAfE/isGTBQChQ84/s320/s3.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-2217409442034996765?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/2217409442034996765/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/05/galaxy.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/2217409442034996765'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/2217409442034996765'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/05/galaxy.html' title='Galaxy'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uea8fC_rl8A/TAOs3ZaR2QI/AAAAAAAAAec/qza0Zae5-sE/s72-c/sombrero_galaxy.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-8994079560620168998</id><published>2010-05-27T06:15:00.000-07:00</published><updated>2010-07-07T02:56:35.782-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='procedural generation'/><category scheme='http://www.blogger.com/atom/ns#' term='Paint'/><title type='text'>Self Painting Images in Flash</title><content type='html'>Leading on from the previous post I decided to automate the painting process. The brush moves around the screen randomly creating a stipple like effect by increasing and decreasing pressure. Take a look, its really quite hypnotic. Just click on the image below to launch it.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/SelfPaint.swf?height=375&amp;amp;width=500" imageanchor="1" rel="prettyPhoto[flash]" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="301" src="http://3.bp.blogspot.com/_uea8fC_rl8A/S_5wFIjaS6I/AAAAAAAAAeE/3d-ugNFPd78/s400/SLEF.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-8994079560620168998?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/8994079560620168998/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/05/self-painting-images-in-flash.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/8994079560620168998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/8994079560620168998'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/05/self-painting-images-in-flash.html' title='Self Painting Images in Flash'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_uea8fC_rl8A/S_5wFIjaS6I/AAAAAAAAAeE/3d-ugNFPd78/s72-c/SLEF.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-3239384108986778848</id><published>2010-05-26T18:01:00.000-07:00</published><updated>2010-07-07T02:56:14.344-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Photoshop'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='procedural generation'/><category scheme='http://www.blogger.com/atom/ns#' term='Paint'/><title type='text'>Wet Paint Mixing in Flash</title><content type='html'>One of my favourite features on Photoshop CS5, is the wet mixer brush, which is almost like a real paintbrush to use. I decided that if photoshop could do it, so could I, and a started to work on writing some actionscript that would handle the job.&lt;br /&gt;
&lt;br /&gt;
The basic idea is that a brush is made up of bristles. When you press down on the screen each bristle picks up a certain amount of paint from the pixel it is currently over, and then as you drag your brush around, each bristle drags paint around underneath it.&lt;br /&gt;
&lt;br /&gt;
To do this I wrote some actionscript that found the colour under each bristle, mixed the paint that was already on the bristle with the new paint underneath it, and then moved that new colour to the new location of the bristle. The program draws the paint stroke onto a new layer, a kind of buffer, which it then blurs (for added realism) and copies back onto the original painting.&lt;br /&gt;
&lt;br /&gt;
Here are a few initial results:&lt;br /&gt;
&lt;br /&gt;
Original Image&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/S_3C3xUVj4I/AAAAAAAAAdk/DSfRrmRyLOU/s1600/Paint1.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_uea8fC_rl8A/S_3C3xUVj4I/AAAAAAAAAdk/DSfRrmRyLOU/s320/Paint1.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Painted version:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_uea8fC_rl8A/S_3C8QYYhLI/AAAAAAAAAds/OU8r_TyQFyg/s1600/Paint2.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="236" src="http://1.bp.blogspot.com/_uea8fC_rl8A/S_3C8QYYhLI/AAAAAAAAAds/OU8r_TyQFyg/s320/Paint2.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And here are a few more examples of another image created with it. I'm actually getting similar results as with the photoshop brushes which I'm quite pleased about. To launch the application simply click &lt;a href="http://experimentalized.com/experimentalized_blog/flsh/Paintbrush.swf?height=375&amp;amp;width=500" rel="prettyPhoto[flash]"&gt;here&lt;/a&gt; and give it a go for yourself. Let me know what you think!&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/S_3DtJUQICI/AAAAAAAAAd0/TdXLhdXqq3M/s1600/Paint1.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_uea8fC_rl8A/S_3DtJUQICI/AAAAAAAAAd0/TdXLhdXqq3M/s320/Paint1.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_uea8fC_rl8A/S_3DxuiXv1I/AAAAAAAAAd8/VrB2-r2ep-Q/s1600/Paint2.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_uea8fC_rl8A/S_3DxuiXv1I/AAAAAAAAAd8/VrB2-r2ep-Q/s320/Paint2.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Lucida Grande'; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-3239384108986778848?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/3239384108986778848/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/05/wet-paint-mixing-in-flash.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/3239384108986778848'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/3239384108986778848'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/05/wet-paint-mixing-in-flash.html' title='Wet Paint Mixing in Flash'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uea8fC_rl8A/S_3C3xUVj4I/AAAAAAAAAdk/DSfRrmRyLOU/s72-c/Paint1.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-5847643244908947100</id><published>2010-05-15T14:43:00.000-07:00</published><updated>2010-05-16T12:31:48.108-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Particles'/><category scheme='http://www.blogger.com/atom/ns#' term='CS5'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><category scheme='http://www.blogger.com/atom/ns#' term='Physics'/><title type='text'>Attempt at "fast" solution to the N-Body Problem</title><content type='html'>The N-Body &amp;nbsp;problem is a very interesting problem both mathematically and in real world applications such as in observational cosmology. The basic idea of the N-Body Problem is, given N gravitationally interacting bodies, what is the most efficient way to solve the subsequent motions of all of the bodies given some initial conditions? I will be looking at the problem in 2 dimensions.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/N-Body.swf?height=400&amp;amp;width=550" imageanchor="1" rel="prettyPhoto[flash]" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" height="292" src="http://4.bp.blogspot.com/_uea8fC_rl8A/S-8VJdd5aEI/AAAAAAAAAcg/-akpkZHvm38/s400/NBODY1.png" width="400" /&gt;&lt;/a&gt;Lets first take a look at the example in its simplest form, with just two bodies. The two bodies pull on each other by the gravitational force, which causes both to accelerate along a vector pointed along the line joining them. This is a very simple problem to solve and any university level physicist should find solving it trivial. In the case of more bodies however, an analytical solution becomes extremely complicated and far beyond the reach of my mathematical understanding; but what I do understand is computers and iterative techniques. The simplest way therefore to solve a problem with more than two bodies would be simply to summate the forces of all the bodies acting on one body at a given moment in time and update its velocity, then repeat this for each of the other bodies in your system.&lt;br /&gt;
&lt;br /&gt;
Obviously for a number of bodies N, the number of force checks that would have to be done would increase very quickly, in fact at a rate N*N, which means for 1000 bodies, 1 million checks would have to be carried out, remember this is per instant in time.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/S-8VPRjEKbI/AAAAAAAAAco/WNt4I7JuERw/s1600/NBODY2.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="291" src="http://3.bp.blogspot.com/_uea8fC_rl8A/S-8VPRjEKbI/AAAAAAAAAco/WNt4I7JuERw/s400/NBODY2.png" width="400" /&gt;&lt;/a&gt;I propose a solution that uses the bitmap functionality in flash, along with the blur filter. I am sure that it won't stand up to rigorous mathematical scrutiny, but from an aesthetic standpoint, it does the job near enough ok.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The idea is that each body is represented by a pixel, with a colour related to its mass. By applying a blur filter on the bitmap, the gravitational field of the pixel is extended into the surrounding region. A brighter region means more gravitational force, and a darker region less. To solve the problem particles simply need to be accelerated along the line of highest gradient towards brighter regions. This way only N checks have to be carried out massively decreasing computing time.&lt;br /&gt;
&lt;br /&gt;
For example carrying out the test with 10,000 particles, which would otherwise kill my computer (at 24 frames per second that would be 2,400,000,000 force checks per second!) it actual runs reasonably well!&lt;br /&gt;
&lt;br /&gt;
Anyway take a look and feel free to make suggestions to improve the model. Just click the first image to launch the simulation!&lt;br /&gt;
&lt;br /&gt;
Note: Limitations of the simulation include -&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Blur is not complete, i.e gravity has a limited range - this may be analogous to simulations of the large scale universe where distances are two large for information to pass between.&lt;/li&gt;
&lt;li&gt;Blur takes multiple steps to update (slow information rate)&lt;/li&gt;
&lt;li&gt;Singularities such as collisions cause erratic behaviour (sudden velocity boosts)&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;Further Note: "Universe" has periodic boundary conditions, i.e X = X + Width &amp;amp; Y = Y + Height&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;Update: Running the simulation with more particles (100,000) without periodic boundary conditions yields interesting results. As expected the "universe" collapses in on its centre of mass. In this simulation I increased the blur distance, i.e the range of gravity, producing less local effects. The second image shows the simulation after it reaches a stable state with a large central mass.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_uea8fC_rl8A/S_BG1F06cjI/AAAAAAAAAcw/MRmt8QFmxXw/s1600/mp.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="291" src="http://1.bp.blogspot.com/_uea8fC_rl8A/S_BG1F06cjI/AAAAAAAAAcw/MRmt8QFmxXw/s400/mp.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/S_BHAXkobWI/AAAAAAAAAc4/JMUB7Pa2MLk/s1600/mp2.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="292" src="http://4.bp.blogspot.com/_uea8fC_rl8A/S_BHAXkobWI/AAAAAAAAAc4/JMUB7Pa2MLk/s400/mp2.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-5847643244908947100?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/5847643244908947100/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/05/attempt-at-fast-solution-to-n-body.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/5847643244908947100'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/5847643244908947100'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/05/attempt-at-fast-solution-to-n-body.html' title='Attempt at &quot;fast&quot; solution to the N-Body Problem'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uea8fC_rl8A/S-8VJdd5aEI/AAAAAAAAAcg/-akpkZHvm38/s72-c/NBODY1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-5725466296610430679</id><published>2010-05-14T02:52:00.000-07:00</published><updated>2010-05-14T02:57:48.964-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Emergence'/><category scheme='http://www.blogger.com/atom/ns#' term='CS5'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>Pedestrian Playground</title><content type='html'>Looking through one of my favourite books, Critical Mass, I came across a page I had been meaning to do some research into. The section of the book was on cellular automata, and the creation of complexity from simple rules. I mentioned a few posts ago about a paper I had read about solving the &lt;a href="http://experimentalized.blogspot.com/2010/03/travelling-salesman-problem.html"&gt;Travelling Salesman problem&lt;/a&gt; using ants. The travelling salesman solves the problem of getting between a number of towns using the shortest route possible. This is all well and good but the travelling salesman has an absolute answer, and in my opinion that immediately makes the problem slightly less interesting. The randomness of the human psyche is far more exciting, and the pedestrian motion created when you bring large groups of people together are often quite surprising. Take a look at the image below for example; the trails connect 3 points of interest&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/S-0Z6Z06BUI/AAAAAAAAAb4/QNFAYFf6GJ4/s1600/WALKERS.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_uea8fC_rl8A/S-0Z6Z06BUI/AAAAAAAAAb4/QNFAYFf6GJ4/s320/WALKERS.png" /&gt;&lt;/a&gt;around a park. None of the paths join any of the 3 target locations in the most efficient way, yet after years of trampling down grass, and the slow fading of former trails, the most desired route (on average) is the one seen here.&lt;br /&gt;
&lt;br /&gt;
Obviously park planners would have a much easier job keeping their lawns meticulous if they could somehow predetermine where people were most likely to walk, thus keeping pedestrians on the paths, and not trampling their grass. This problem is slightly more subtle than the travelling salesman, there are in fact &amp;nbsp;many solutions and they depend on a huge number of factors: how many people want to go to each destination, how fast does grass regrow, how fast does a path form, how many people commute along the paths each day, do people have to walk uphill, is there a fence...? Obviously the list goes on for quite a while, after all humans are not predictable, but we can still create a simple model.&lt;br /&gt;
&lt;br /&gt;
The screenshots below show the main interface of my application, just click the first image to launch it. The number of target towns, and the number of people can be changed, as can the size of random fluctuations in direction, the effect of the destination on the direction walked, and the effect of the route on the direction walked. Two factors called visibility, and distance factor also affect the likelyhood that a pedestrian will take the most direct route to their destination. Have a play around with the factors and see if you can reproduce the pattern seen above.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/ActiveWalker.swf?height=400&amp;amp;width=700" imageanchor="1" rel="prettyPhoto[flash]" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="228" src="http://3.bp.blogspot.com/_uea8fC_rl8A/S-0bglHlbFI/AAAAAAAAAcA/7iVBuKf64GY/s400/APPSCREEN.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the below examples you can see paths merging, even though this is not the most efficient route for anyone. The first image still has some "visibility", the second has absolutely none, people just tend to congregate randomly, but it does make a nice pattern, and the third shows path splitting, where two similar but separate routes form spontaneously.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_uea8fC_rl8A/S-0cIHHWGhI/AAAAAAAAAcI/YbsS61rPlJQ/s1600/Path+Creation.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="227" src="http://2.bp.blogspot.com/_uea8fC_rl8A/S-0cIHHWGhI/AAAAAAAAAcI/YbsS61rPlJQ/s400/Path+Creation.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_uea8fC_rl8A/S-0cNCoVCcI/AAAAAAAAAcQ/wNElZYPbOEc/s1600/Paths.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="230" src="http://1.bp.blogspot.com/_uea8fC_rl8A/S-0cNCoVCcI/AAAAAAAAAcQ/wNElZYPbOEc/s400/Paths.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_uea8fC_rl8A/S-0cRqpEtQI/AAAAAAAAAcY/5KgCOacnWLo/s1600/Paths2.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="231" src="http://2.bp.blogspot.com/_uea8fC_rl8A/S-0cRqpEtQI/AAAAAAAAAcY/5KgCOacnWLo/s400/Paths2.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-5725466296610430679?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/5725466296610430679/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/05/pedestrian-playground.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/5725466296610430679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/5725466296610430679'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/05/pedestrian-playground.html' title='Pedestrian Playground'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_uea8fC_rl8A/S-0Z6Z06BUI/AAAAAAAAAb4/QNFAYFf6GJ4/s72-c/WALKERS.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-4268914412016281758</id><published>2010-04-12T10:09:00.000-07:00</published><updated>2010-07-07T02:54:47.480-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Animation'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>Nice Little Cloud Effect</title><content type='html'>Came up with a nice little moving cloud effect great for flash sites. The cloud texture was created using photoshop, and the Render -&amp;gt; Clouds, and Render -&amp;gt; Difference Clouds filters. Using the blur tool I created repeatable tiles then transferred the images into flash. The movie consists simply of two cloud images scrolling at different speeds, scales and transparencies. Another nice feature is that the movie is fully resizable up to almost any scale - within reason.&lt;br /&gt;
&lt;br /&gt;
Just click the image to try it out!&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/clouds.swf?height=600&amp;amp;width=800" imageanchor="1" rel="prettyPhoto[flash]" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="262" src="http://4.bp.blogspot.com/_uea8fC_rl8A/S8NTKVjZWBI/AAAAAAAAAbw/82VDLWxXkGg/s400/Clouds.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-4268914412016281758?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/4268914412016281758/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/04/nice-little-cloud-effect.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/4268914412016281758'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/4268914412016281758'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/04/nice-little-cloud-effect.html' title='Nice Little Cloud Effect'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uea8fC_rl8A/S8NTKVjZWBI/AAAAAAAAAbw/82VDLWxXkGg/s72-c/Clouds.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-4455734525581979693</id><published>2010-04-05T04:30:00.000-07:00</published><updated>2010-04-05T04:30:50.202-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fun'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>Zoom Quilt</title><content type='html'>I remember seeing this years and years ago, around the time I was first getting into flash. Looking at the date it was made in 2004. The project known as the Zoom Quilt, was a collaboration between various artists and is a beautiful illustration (excuse the pun) of what can be done in flash. Click the image to run the file, and use the mouse to drag in and out of the quilt.&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a rel="prettyPhoto[flash]" href="http://experimentalized.com/experimentalized_blog/flsh/zoomquilt.swf?height=600px&amp;width=800px" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/_uea8fC_rl8A/S7nJkU-7l_I/AAAAAAAAAbo/_wrI877HnKA/s400/ZQ.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-4455734525581979693?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/4455734525581979693/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/04/zoom-quilt.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/4455734525581979693'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/4455734525581979693'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/04/zoom-quilt.html' title='Zoom Quilt'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uea8fC_rl8A/S7nJkU-7l_I/AAAAAAAAAbo/_wrI877HnKA/s72-c/ZQ.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-3647894599538828074</id><published>2010-03-26T08:36:00.000-07:00</published><updated>2010-07-07T02:53:57.076-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mathematics'/><category scheme='http://www.blogger.com/atom/ns#' term='Optimisation'/><title type='text'>Travelling Salesman Problem</title><content type='html'>I have been extremely busy over the last few weeks with various University projects, so the genetic algorithm work has moved to the bottom of the stack. The ideas and problems are still quite fresh in my mind, so without going straight into programming the physics based evolving creatures, I'm going to have a look at something else quite closely related. It is linked in to both evolution and optimization. There is a very old mathematical problem, known as the travelling salesman problem (TSP). The TSP involves finding the shortest route between a number of cities, visiting each city only once. &lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://upload.wikimedia.org/wikipedia/commons/c/c4/TSP_Deutschland_3.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" nt="true" src="http://upload.wikimedia.org/wikipedia/commons/c/c4/TSP_Deutschland_3.png" width="298" /&gt;&lt;/a&gt;&lt;/div&gt;Finding fast solutions to the problem is vital for applications such as route finding on maps. Anyway, I recently read an interesting paper one approach to solving the TSP ( &lt;a href="http://www.idsia.ch/~luca/acs-bio97.pdf"&gt;Ant colonies for the traveling salesman problem&lt;/a&gt;&amp;nbsp;). The paper shows that using ant agents, which lay virtual pheremones, a shortest path can be found. Ants prefer to follow paths with more pheremones on them - this means that shorter paths will build up more pheremones because more ants will travel along them.&lt;br /&gt;
&lt;br /&gt;
When I get back to my computer I will have a look at creating a similar solution to the problem in flash, and see the kinds of results that can be produced. &lt;br /&gt;
&lt;br /&gt;
It might also be interesting to look at the effects of changing the properties of ants on how well the system optimizes itself. &lt;br /&gt;
&lt;br /&gt;
I'll get back to you with any results!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-3647894599538828074?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/3647894599538828074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/03/travelling-salesman-problem.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/3647894599538828074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/3647894599538828074'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/03/travelling-salesman-problem.html' title='Travelling Salesman Problem'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-6696766856546702318</id><published>2010-03-16T10:00:00.000-07:00</published><updated>2010-07-07T02:53:20.005-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='Animation'/><category scheme='http://www.blogger.com/atom/ns#' term='Cinema 4D'/><title type='text'>3D Experiments - New Toy</title><content type='html'>I've been quite excited at the moment, playing around with my new toy &lt;b&gt;Cinema 4d&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
Here are some of of the first things I've made - click the images to run the videos. The first uses bullet physics and the second uses Cinema's hair plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.youtube.com/watch?v=8OjgwFqrKWs" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="480" src="http://3.bp.blogspot.com/_uea8fC_rl8A/S51ojWEW2QI/AAAAAAAAAbY/H3RVBzyKqB4/s640/Screen.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.youtube.com/watch?v=4wHmSOQ4MsY" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="434" src="http://4.bp.blogspot.com/_uea8fC_rl8A/S5-46--v-JI/AAAAAAAAAbg/n_3C20MaXbM/s640/grasssim.jpg" vt="true" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-6696766856546702318?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/6696766856546702318/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/03/3d-experiments-new-toy.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6696766856546702318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6696766856546702318'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/03/3d-experiments-new-toy.html' title='3D Experiments - New Toy'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_uea8fC_rl8A/S51ojWEW2QI/AAAAAAAAAbY/H3RVBzyKqB4/s72-c/Screen.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-7912661716503126956</id><published>2010-03-07T15:03:00.000-08:00</published><updated>2010-07-07T02:52:52.877-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Genetic Algorithms'/><title type='text'>Creature Evolution in Flash: First Thoughts</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/S5QwgDxEsUI/AAAAAAAAAbQ/99YzwawG_i4/s1600/Evolution.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="512" src="http://3.bp.blogspot.com/_uea8fC_rl8A/S5QwgDxEsUI/AAAAAAAAAbQ/99YzwawG_i4/s640/Evolution.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-7912661716503126956?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/7912661716503126956/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/03/creature-evolution-in-flash-first.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/7912661716503126956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/7912661716503126956'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/03/creature-evolution-in-flash-first.html' title='Creature Evolution in Flash: First Thoughts'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_uea8fC_rl8A/S5QwgDxEsUI/AAAAAAAAAbQ/99YzwawG_i4/s72-c/Evolution.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-6792063642585024287</id><published>2010-03-06T14:02:00.000-08:00</published><updated>2010-07-07T02:52:31.920-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='music visualizer'/><category scheme='http://www.blogger.com/atom/ns#' term='Particles'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><title type='text'>Simple 3D Music Visualizer</title><content type='html'>Just played around a bit with the 3D fluid dynamics thing I made a few days ago. I added some computeSpectrum functionality using the Flash 10 audio features and created a very basic music visualizer. I'm not entirely happy with it but its worth a post, just click to start it up (the song might take a while to load):&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/3DVisuals.swf?height=400&amp;amp;width=550" imageanchor="1" rel="prettyPhoto[flash]" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_uea8fC_rl8A/S5LP9FuH21I/AAAAAAAAAbI/dRCiwyjkzBI/s320/Visualizer.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
The song is "Rabbit In Your Headlights" by Unkle, enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-6792063642585024287?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/6792063642585024287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/03/simple-3d-music-visualizer.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6792063642585024287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6792063642585024287'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/03/simple-3d-music-visualizer.html' title='Simple 3D Music Visualizer'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uea8fC_rl8A/S5LP9FuH21I/AAAAAAAAAbI/dRCiwyjkzBI/s72-c/Visualizer.png' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-8769205105461546517</id><published>2010-03-06T03:27:00.000-08:00</published><updated>2010-07-07T02:52:11.168-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='procedural generation'/><category scheme='http://www.blogger.com/atom/ns#' term='Genetic Algorithms'/><title type='text'>Image Evolution: Madame Mattisse</title><content type='html'>I've come back with a new and improved evolution algorithm, one which doesn't stop evolving after 300 generations! I've also uploaded the movie with a bit of a UI which you can have a play around with and see how well you can evolve the images. The ones below show the kind of evolution you might be able to achieve. I've also changed the fitness function image to one of my favourite paintings of all time, Madame Matisse, by Matisse. Just click &lt;a href="http://experimentalized.com/experimentalized_blog/flsh/EVO_1.1.swf?width=600&amp;amp;height=400" rel="prettyPhoto[flash]"&gt;here&lt;/a&gt; to launch the movie.&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/S5I7EardGfI/AAAAAAAAAa4/ZVgl8W4xwWc/s1600-h/Mattise1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_uea8fC_rl8A/S5I7EardGfI/AAAAAAAAAa4/ZVgl8W4xwWc/s320/Mattise1.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_uea8fC_rl8A/S5I7KDzY3XI/AAAAAAAAAbA/8n7umor5coU/s1600-h/Mattise12+copy.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_uea8fC_rl8A/S5I7KDzY3XI/AAAAAAAAAbA/8n7umor5coU/s320/Mattise12+copy.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
Enjoy the Genetic Algorithm fun!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-8769205105461546517?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/8769205105461546517/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/03/image-evolution-madame-mattisse.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/8769205105461546517'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/8769205105461546517'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/03/image-evolution-madame-mattisse.html' title='Image Evolution: Madame Mattisse'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_uea8fC_rl8A/S5I7EardGfI/AAAAAAAAAa4/ZVgl8W4xwWc/s72-c/Mattise1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-6896808386618983312</id><published>2010-03-05T14:07:00.000-08:00</published><updated>2010-07-07T02:51:48.571-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='procedural generation'/><category scheme='http://www.blogger.com/atom/ns#' term='Genetic Algorithms'/><title type='text'>A Brief Look At Genetic Algorithms</title><content type='html'>This post is sort of a continuation of my work on natural selection and evolution as a tool for image compression. Genetic algorithms are an extremely interesting area of study, and over the next few weeks I'll be exploring the kinds of things that can be achieved in the field using actionscript and the flash player. Genetic algorithms are being used to evolve some of the most advanced robots in the world, as well as being used in route finding and compression applications.&lt;br /&gt;
&lt;br /&gt;
So what is a genetic algorithm? In a nutshell it is a computational technique through which solutions to &lt;a href="http://en.wikipedia.org/wiki/Optimization_(mathematics)"&gt;optimization&lt;/a&gt; problems can be found. It is an evolutionary method that can be compared to the way evolution and natural selection work in the biological world. A genetic algorithm requires two things to work, a genetic representation of the thing you are trying to evolve, and what is known as a fitness function to compare your genes against.&lt;br /&gt;
&lt;br /&gt;
Lets take the example found in the video below (click the image and it should start up):&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.youtube.com/watch?v=F0OHycypSG8" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="151" src="http://4.bp.blogspot.com/_uea8fC_rl8A/S5F5hs1G2OI/AAAAAAAAAaw/4eZ-XEJDMso/s200/Simulation.png" width="200" /&gt;&lt;/a&gt;Each creature is represented by a set of genetic data. This determines everything about that creature, how big it is, where it has joints, any muscles it might have and how it decides to use them and so on.&lt;br /&gt;
&lt;br /&gt;
By comparing the phenotype (the physical outcome of the genes) to a fitness function, we are able to determine how suited a certain version of the creature is to performing a certain task. Examples of fitness functions include the ability to swim fast, the ability to jump, or the ability to win in a game of football.&lt;br /&gt;
&lt;br /&gt;
Currently there is no evolution going on at all, so we need to introduce random mutations in the genetic data. You should be able to see that a random mutation might cause a creature to be more effective at carrying out the fitness function, if it is we can stick to the new set of genes, otherwise lets go back to the original.&lt;br /&gt;
&lt;br /&gt;
In my program to evolve an image from a few polygons the fitness function was the similarity to the comparison image.&lt;br /&gt;
&lt;br /&gt;
So now that we've discussed computational genetics briefly, how am I going to work this all into a flash project. The first issue is creating a physical world in which my creatures can evolve. Clearly I don't have the computational power to test millions of creatures in 3D with a 3D physics engine, so that isn't an option. I have decided to stick with a simple 2D Verlet Integration based particle engine with constraints and muscles (no line-line or polygon-polygon collisions) and see what happens.&lt;br /&gt;
&lt;br /&gt;
I am quite excited about seeing where this one is going to go, so stay tuned!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-6896808386618983312?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/6896808386618983312/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/03/brief-look-at-genetic-algorithms.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6896808386618983312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6896808386618983312'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/03/brief-look-at-genetic-algorithms.html' title='A Brief Look At Genetic Algorithms'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uea8fC_rl8A/S5F5hs1G2OI/AAAAAAAAAaw/4eZ-XEJDMso/s72-c/Simulation.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-3635615314762741930</id><published>2010-03-03T13:23:00.000-08:00</published><updated>2010-07-07T02:51:32.194-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='procedural generation'/><category scheme='http://www.blogger.com/atom/ns#' term='Genetic Algorithms'/><category scheme='http://www.blogger.com/atom/ns#' term='image encoding'/><title type='text'>Image Evolution</title><content type='html'>Based on the work by &lt;a href="http://rogeralsing.com/2008/12/07/genetic-programming-evolution-of-mona-lisa/"&gt;Roger Alsing&lt;/a&gt;&amp;nbsp;I thought I'd create a real time evolving image. Initially 30 random numbers are generated from a seed, these numbers are the components of the DNA strand. Each number corresponds to a specific polygon with a characteristic colour, transparency and number of vertices. A mutation in the DNA strand results in a shape changes. Images before and after a mutation are compared to the original painting, Girl With A Pearl Earring, and if a mutation causes greater similarity, then the mutation holds, otherwise the DNA reverts to its previous form. This is similar to how evolution works in the biological world.&lt;br /&gt;
&lt;br /&gt;
Here are the first few mutations showing development of the image:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=8133808492150620948&amp;amp;postID=3635615314762741930" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="177" src="http://3.bp.blogspot.com/_uea8fC_rl8A/S47R-0gvYfI/AAAAAAAAAZw/mPcCjGOT_VM/s320/1.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=8133808492150620948&amp;amp;postID=3635615314762741930" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="172" src="http://1.bp.blogspot.com/_uea8fC_rl8A/S47SEKbU08I/AAAAAAAAAZ4/TWTsO1uxdCI/s320/2.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=8133808492150620948&amp;amp;postID=3635615314762741930" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="170" src="http://4.bp.blogspot.com/_uea8fC_rl8A/S47SI7vck3I/AAAAAAAAAaA/wUtNf4oZRZo/s320/3.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=8133808492150620948&amp;amp;postID=3635615314762741930" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_uea8fC_rl8A/S47SQsnNQiI/AAAAAAAAAaI/2kQSrx2Xtok/s320/4.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are early stages, with up to 165 successful mutations. I will leave the program running over night, and will update the results. The lack of computational power in AS3 and my completely un-optimised code means that comparison processes take quite a while. One way to improve speed would be to reduce canvas size so I may turn to this if the program doesn't produce anything nice.&lt;br /&gt;
&lt;br /&gt;
Having said that the early results are making me feel optimistic. We just need a few more thousand mutations and it'll be there.&lt;br /&gt;
&lt;br /&gt;
Update: Here are the 198th and 238th mutations, I don't think the image will look that interesting until it gets into the 1000s. Its getting there but its clear that its a long process. Unfortunately the rate of improvement also slows down. Its up to about 15000 mutation attempts, and its taking longer and longer to mutate successfully each time. Currently only up to 10 vertices are allowed per polygon. Increasing this maximum number to more could increase the rate of improvement. As could allowing other sorts of mutation such as gene swapping, where two of the seed numbers swap. I'll give this a go soon although I will let this version go to 1000 mutations just to see the results.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://1.bp.blogspot.com/_uea8fC_rl8A/S47eVuZ2rXI/AAAAAAAAAaQ/7sctyASB9Jk/s1600/5.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="161" src="http://1.bp.blogspot.com/_uea8fC_rl8A/S47eVuZ2rXI/AAAAAAAAAaQ/7sctyASB9Jk/s320/5.png" width="320" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://1.bp.blogspot.com/_uea8fC_rl8A/S47evvRGLWI/AAAAAAAAAaY/Emwka-58s_I/s1600/6.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_uea8fC_rl8A/S47evvRGLWI/AAAAAAAAAaY/Emwka-58s_I/s320/6.png" /&gt;&lt;/a&gt;&lt;br /&gt;
Update: Just a though on using this as a compression technique. Each seed number is a 32bit integer. This means 30 numbers comes to 960bits or 120bytes per image. Given that the original version of the image I used (a PNG so already compressed) comes to 231kBytes, thats a compression factor of about 2000. Even using 100 polygons (a factor which would drastically improve the final evolution of the image) the compression factor would still be around 600! This is very impressive. I remember reading about a competition somewhere to send images as twitter messages (a twitter message contains up to 120 characters or 120bytes of ascii?) This means that the images I have produced could indeed be sent as twitter messages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Update: The evolution process seems to be levelling off at about 360 successful evolutions with over 1.6 Million evolution attempts. This leads me to believe that my evolution parameters weren't ideal. The two images below shows the image as far as I'm going to take it. The second shows a blurred image applied and actually the result is pretty good when compared to the blurred original (in other words when you squint you should be able to see the original image. I'll come back when to you when I've improved the parameters and algorithm slightly!&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_uea8fC_rl8A/S4_rhbhqNiI/AAAAAAAAAag/Imh8YHYhk8Q/s1600-h/9.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_uea8fC_rl8A/S4_rhbhqNiI/AAAAAAAAAag/Imh8YHYhk8Q/s320/9.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://2.bp.blogspot.com/_uea8fC_rl8A/S4_rmL8ww9I/AAAAAAAAAao/FRQefJluIo8/s1600-h/10.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_uea8fC_rl8A/S4_rmL8ww9I/AAAAAAAAAao/FRQefJluIo8/s320/10.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-3635615314762741930?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/3635615314762741930/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/03/image-evolution.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/3635615314762741930'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/3635615314762741930'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/03/image-evolution.html' title='Image Evolution'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_uea8fC_rl8A/S47R-0gvYfI/AAAAAAAAAZw/mPcCjGOT_VM/s72-c/1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-6728238277090078780</id><published>2010-03-03T08:17:00.000-08:00</published><updated>2010-07-07T02:50:47.807-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='fluid dynamics'/><category scheme='http://www.blogger.com/atom/ns#' term='Particles'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><title type='text'>3D Waves: Projected 2D fluid simulation</title><content type='html'>&lt;div style="text-align: left;"&gt;I found this experiment quite interesting. In an earlier post I gave an example of a 2-dimension fluid simulation that I'd been working on using the Navier-Stokes equations. I decided to play around with this code a bit and use the 3D point engine from my last experiment in conjunction with the fluid engine. The density from the fluid simulation is simply projected onto the XZ plane with density values corresponding to the height of corresponding point particles.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/3D_Fluid.swf?height=400&amp;amp;width=550" imageanchor="1" rel="prettyPhoto[flash]" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="290" src="http://2.bp.blogspot.com/_uea8fC_rl8A/S46KovvHdCI/AAAAAAAAAZo/UeJxWTd8mEs/s400/3DWAVE.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The results are certainly interesting. Click the image below to start up the experiment. To create waves just move your mouse around and drag the movie to change the camera angle. I decided to add a slight fade and blur on the particles which makes it look very pretty. Enjoy!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-6728238277090078780?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/6728238277090078780/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/03/3d-waves-projected-2d-fluid-simulation.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6728238277090078780'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6728238277090078780'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/03/3d-waves-projected-2d-fluid-simulation.html' title='3D Waves: Projected 2D fluid simulation'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_uea8fC_rl8A/S46KovvHdCI/AAAAAAAAAZo/UeJxWTd8mEs/s72-c/3DWAVE.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-2247777326506445467</id><published>2010-02-24T10:26:00.000-08:00</published><updated>2010-07-07T02:50:25.633-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='Particles'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><title type='text'>OBJ Vertex Renderer</title><content type='html'>Just a really simple and quick experiment, to see if I could load a Wavefront .obj file into a flash movie and render the vertex co-ordinates in real time, in three dimensions. Just click the image below to launch the experiment. The object contains about 30,000 vertices, and these are simply transformed from 3D to 2D space and displayed using bitmap data. This is nowhere near as complicated as my prior attempt at a 3D engine, but I decided to make performance more of an issue this time. It does run at full frame rate quite happily on my computer. Let me know about your experiences.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/BASIC_3D.swf?height=400&amp;amp;width=550" imageanchor="1" rel="prettyPhoto[flash]" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="288" src="http://2.bp.blogspot.com/_uea8fC_rl8A/S4Vu3dSdtVI/AAAAAAAAAZY/SupyaqJvu4c/s400/SCREEN.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;The next step is an edge renderer (wireframe), then a face renderer. We'll see how high the performance can stay. Obviously the ideal case is a high quality raytrace in real time with shadows, reflections and more, but lets not kid ourselves.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-2247777326506445467?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/2247777326506445467/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/02/obj-vertex-renderer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/2247777326506445467'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/2247777326506445467'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/02/obj-vertex-renderer.html' title='OBJ Vertex Renderer'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_uea8fC_rl8A/S4Vu3dSdtVI/AAAAAAAAAZY/SupyaqJvu4c/s72-c/SCREEN.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-2159967920907895710</id><published>2010-02-23T15:41:00.000-08:00</published><updated>2010-07-07T02:50:01.825-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Classes'/><title type='text'>Image Transform Tool</title><content type='html'>I've just been playing around with &lt;a href="http://www.rubenswieringa.com/blog/distortimage"&gt;this&lt;/a&gt; little class made by &lt;a href="http://www.rubenswieringa.com/portfolio/flash/"&gt;Ruben Swieringa&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
It allows any image to be transformed by providing any four corner points. In the demo I used an animation of mine (&lt;a href="http://experimentalized.com/"&gt;Strange Attractors&lt;/a&gt;).&lt;br /&gt;
&lt;br /&gt;
Click on the image to begin then try dragging around the corners. I'll see if I can come up with any other experiments using this neat class. Any bitmap data can be used, so videos, images and animations can all be dragged around in 3 dimensions....&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/DistortImage.swf?height=400px&amp;amp;width=550px" imageanchor="1" rel="prettyPhoto[flash]" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="218" src="http://4.bp.blogspot.com/_uea8fC_rl8A/S4Rm_NXxFwI/AAAAAAAAAZQ/fS4dSsF7NO4/s320/SCREEN.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-2159967920907895710?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/2159967920907895710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/02/image-transform-tool.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/2159967920907895710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/2159967920907895710'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/02/image-transform-tool.html' title='Image Transform Tool'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uea8fC_rl8A/S4Rm_NXxFwI/AAAAAAAAAZQ/fS4dSsF7NO4/s72-c/SCREEN.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-824340650810434536</id><published>2010-02-18T04:10:00.000-08:00</published><updated>2010-04-09T04:50:37.586-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='webcam'/><category scheme='http://www.blogger.com/atom/ns#' term='shape recognition'/><category scheme='http://www.blogger.com/atom/ns#' term='face recognition'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><category scheme='http://www.blogger.com/atom/ns#' term='image encoding'/><title type='text'>Face Recognition Algorithms</title><content type='html'>Over the last few days I have been looking at a various algorithms and methods used in face recognition processes.&amp;nbsp;The first method I looked at uses a colour space known as TSL (closely related to HSL - hue, saturation, luminosity). This colour space was developed with the intention of being far closer to the way the human brain sees colours than RGB and other computationally preferred systems. Taking a webcam stream and converting all pixels into TSL colour space with [R,G,B] -&amp;gt; [T,S,L], I found that although in certain lighting conditions the system can differentiate between skin colour and other surfaces, the method is far from ideal. For example the cream walls in my house can often be identified as skin colour, which clearly shows an issue. It is also clear from the images that areas of my face that are in shade are not recognised as skin. These issues are best addressed using methods that do not depend on colour.&lt;br /&gt;
&lt;br /&gt;
&lt;a imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="145" src="http://3.bp.blogspot.com/_uea8fC_rl8A/S30nCjZ5XuI/AAAAAAAAAYo/RFcovesOMZQ/s200/TSL2.png" width="200" /&gt;&lt;/a&gt;&lt;a imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" height="141" src="http://3.bp.blogspot.com/_uea8fC_rl8A/S30m-SxG5rI/AAAAAAAAAYg/JZWjX__ls6Y/s200/TSL1.png" width="200" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In my research I found two viable methods for use in face recognition, using &lt;a href="http://en.wikipedia.org/wiki/Eigenface"&gt;eigenfaces&lt;/a&gt;, and fisherfaces.&lt;br /&gt;
&lt;br /&gt;
Eigenfaces seemed to be a more commonly used method, so I decided to follow that route first (albeit roughly, as I'm sure you all know by now I like to do things my own way when I program). In order to recognise a face in an image, the computer has to be trained to know what a face looks like. The first step involved writing a class to import .pgm files from the &lt;a href="http://vasc.ri.cmu.edu/idb/html/face/index.html"&gt;CMU face database&lt;/a&gt;. Here is a sample of what the faces looked like when imported. All images are in the frontal pose, &amp;nbsp;with similar lighting conditions, and varying facial expressions.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_uea8fC_rl8A/S30ql3OT7HI/AAAAAAAAAYw/IknlwjsUXEs/s1600/faces.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="148" src="http://2.bp.blogspot.com/_uea8fC_rl8A/S30ql3OT7HI/AAAAAAAAAYw/IknlwjsUXEs/s320/faces.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;The next three steps involved creating an average face, and taking the resulting image and calculating it's vertical and horizontal gradients. The average face simply sums all of the pixels at each location for each face, and takes the average value. To calculate the gradient the difference between two adjacent pixels is taken in either the vertical or the horizontal direction. Computers find it easy to see vertical and horizontal lines (I have already written some &lt;a href="http://experimentalized.blogspot.com/2009/05/shape-recognition.html"&gt;basic shape detection&lt;/a&gt; software which uses these kinds of algorithms) so I thought this might be a good idea to use these as comparisons with found faces. I planned on using a kind of probability test, with a threshold as to the likeliness that any part of the image is a face, by comparing it to the mean face, the horizontal gradient face, and the vertical gradient face.&lt;br /&gt;
&lt;br /&gt;
The three faces found are shown below for this database. Clearly one could find the mean face of all people wearing glasses, or all men, or all women, and this would affect it's final appearance. Therefore it could theoretically be simple to build in gender testing using webcams (assuming a complete lack of androgyny which clearly there is not....), but a probabilistic approach could still be taken.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=8133808492150620948&amp;amp;postID=824340650810434536" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://4.bp.blogspot.com/_uea8fC_rl8A/S30s4ezjN7I/AAAAAAAAAY4/HCIG8rilVto/s200/MeanFace.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=8133808492150620948&amp;amp;postID=824340650810434536" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://3.bp.blogspot.com/_uea8fC_rl8A/S30tDfSC-4I/AAAAAAAAAZI/mzmVA_Yt33Y/s200/Horiface.png" width="199" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=8133808492150620948&amp;amp;postID=824340650810434536" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://1.bp.blogspot.com/_uea8fC_rl8A/S30s_eeYmqI/AAAAAAAAAZA/w__shrtLwEg/s200/Vertface.png" width="197" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
The mean face looks incredibly symmetric and smooth. This is perfection folks, and its kind of frightening! The idea behind using these for face recognition is relatively simple. Scan an image taking the difference between an overlaid mean face, and the region of the image being scanned. If the difference is below a threshold it means that the images are similar. This means it is likely that there is a face where you are checking. To ensure it is a face consider the horizontal and vertical gradients of the mean and compare them. If they are similar to within a certain threshold it is very likely you have found a face!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;I'll come back to you when I have some working flash files and source code!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-824340650810434536?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/824340650810434536/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/02/face-recognition-algorithms.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/824340650810434536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/824340650810434536'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/02/face-recognition-algorithms.html' title='Face Recognition Algorithms'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_uea8fC_rl8A/S30nCjZ5XuI/AAAAAAAAAYo/RFcovesOMZQ/s72-c/TSL2.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-4079244492910230305</id><published>2010-02-09T11:08:00.000-08:00</published><updated>2010-04-05T04:20:44.075-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='augmented reality'/><category scheme='http://www.blogger.com/atom/ns#' term='fun'/><title type='text'>Three Dimensional Projection</title><content type='html'>I came across a very interesting video recently. A design agency from the Netherlands called NuFormer Media have mapped various famous buildings in 3 dimensions. Using the three dimensional data, images can be projected onto the building, with amazing accuracy. The results are amazing and quite hypnotising, I especially like the crumbling building at about 36 seconds in. Just watch the video below!&lt;br /&gt;
&lt;br /&gt;
&lt;object height="230" width="400"&gt;&lt;param name="allowfullscreen" value="true" /&gt;&lt;param name="allowscriptaccess" value="always" /&gt;&lt;param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=4238052&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1" /&gt;&lt;embed src="http://vimeo.com/moogaloop.swf?clip_id=4238052&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="230"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-4079244492910230305?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/4079244492910230305/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/02/three-dimensional-projection.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/4079244492910230305'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/4079244492910230305'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/02/three-dimensional-projection.html' title='Three Dimensional Projection'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-656334307814119453</id><published>2010-02-04T16:09:00.000-08:00</published><updated>2010-04-05T04:19:57.074-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Particles'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>Followers: 20,000 particles</title><content type='html'>I've been playing around with vectors and decided to see how many particles I could get to follow my mouse using bitmap data. Using 300,000 particles (nearly half a million) I clocked around 2fps, I decided to add a few more effects (colours, trigonometry for the following etc) and found the simulation to run at max fps up until around 20,000. Not bad at all and some of the effects look really pretty! Here are some screenshots, or just press &lt;a href="http://experimentalized.com/experimentalized_blog/flsh/ManyParticles.swf?height=550&amp;amp;width=550" rel="prettyPhoto[flash]"&gt;here&lt;/a&gt; to run the app. You can use the slider at the bottom to change the number of particles from anything between 20 and 20,000.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/S2thIJ3q2hI/AAAAAAAAAYA/6CfoM1hCeI0/s1600/eg1.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/_uea8fC_rl8A/S2thIJ3q2hI/AAAAAAAAAYA/6CfoM1hCeI0/s320/eg1.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center; text-decoration: underline;"&gt;&lt;a href="http://2.bp.blogspot.com/_uea8fC_rl8A/S2thNIpYPdI/AAAAAAAAAYI/vp8-zGkXwIo/s1600/eg2.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em; text-decoration: none;"&gt;&lt;img border="0" height="320" src="http://2.bp.blogspot.com/_uea8fC_rl8A/S2thNIpYPdI/AAAAAAAAAYI/vp8-zGkXwIo/s320/eg2.png" width="320" /&gt;&lt;/a&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/ManyParticlesBlur.swf?height=550&amp;amp;width=550" imageanchor="1" rel="prettyPhoto[flash]" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em; text-decoration: none;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_uea8fC_rl8A/S2tsBaoIgtI/AAAAAAAAAYQ/MEpqNwgEZwg/s320/eg3.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;The third picture above uses a blur filter on the bitmap data, some of the visuals created with this version of the program are really beautiful. Check it out by clicking the image!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-656334307814119453?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/656334307814119453/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/02/followers-20000-particles.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/656334307814119453'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/656334307814119453'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/02/followers-20000-particles.html' title='Followers: 20,000 particles'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uea8fC_rl8A/S2thIJ3q2hI/AAAAAAAAAYA/6CfoM1hCeI0/s72-c/eg1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-7665440149211477173</id><published>2010-02-04T14:34:00.000-08:00</published><updated>2010-02-04T14:35:29.081-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='ray tracing'/><category scheme='http://www.blogger.com/atom/ns#' term='raytracer'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>Chrome Effect Ray Tracer</title><content type='html'>Applying a chrome filter to a finished ray trace render creates an amazing effect. Take a look for yourself. I'm in the process of developing online software where you'll be able to create simple 3D scenes and raytrace them with a number of effects; including anaglyph 3D, chrome and a few more! This is my screensaver at the moment:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a  rel="prettyPhoto" href="http://3.bp.blogspot.com/_uea8fC_rl8A/S2tLVM6pXHI/AAAAAAAAAX4/3HRqO6R0S9w/s1600/raytracing.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://3.bp.blogspot.com/_uea8fC_rl8A/S2tLVM6pXHI/AAAAAAAAAX4/3HRqO6R0S9w/s640/raytracing.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-7665440149211477173?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/7665440149211477173/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/02/chrome-effect-ray-tracer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/7665440149211477173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/7665440149211477173'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/02/chrome-effect-ray-tracer.html' title='Chrome Effect Ray Tracer'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_uea8fC_rl8A/S2tLVM6pXHI/AAAAAAAAAX4/3HRqO6R0S9w/s72-c/raytracing.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-2833162511968529550</id><published>2010-02-02T15:37:00.000-08:00</published><updated>2010-02-02T15:37:48.325-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fractal'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='procedural generation'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>Road Generation: First Attempt</title><content type='html'>I decided to take a look at using Voronoi diagrams to generate road systems. Here are a few very early screenshots! Looks promising.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a rel="prettyPhoto" href="http://1.bp.blogspot.com/_uea8fC_rl8A/S2i25P2a7BI/AAAAAAAAAXo/cxpMCZUsOGw/s1600/v1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_uea8fC_rl8A/S2i25P2a7BI/AAAAAAAAAXo/cxpMCZUsOGw/s320/v1.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a rel="prettyPhoto" href="http://4.bp.blogspot.com/_uea8fC_rl8A/S2i29OmVdHI/AAAAAAAAAXw/vx_3zui2GWk/s1600/v2.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_uea8fC_rl8A/S2i29OmVdHI/AAAAAAAAAXw/vx_3zui2GWk/s320/v2.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-2833162511968529550?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/2833162511968529550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/02/road-generation-first-attempt.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/2833162511968529550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/2833162511968529550'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/02/road-generation-first-attempt.html' title='Road Generation: First Attempt'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_uea8fC_rl8A/S2i25P2a7BI/AAAAAAAAAXo/cxpMCZUsOGw/s72-c/v1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-524819302259648461</id><published>2010-01-29T16:13:00.000-08:00</published><updated>2010-02-03T12:26:44.170-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Emergence'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='procedural generation'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>Terrain Generation</title><content type='html'>Time for another post and another experiment. I was just reading an interesting paper called Procedural Techniques For City Generation by some chaps in working at the ITB in ireland all about how to generate completely algorithmic city plans given a starting point and a landscape to build on. The image below&amp;nbsp;shows an example of some of the stuff that can be produced with these algorithms and it truly is amazing!&lt;br /&gt;
&lt;br /&gt;
&lt;a imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_uea8fC_rl8A/S2N1WWa2gjI/AAAAAAAAAXA/0TmPii6ulMo/s320/2304935268_6e3b92f5f8.jpg" /&gt;&lt;/a&gt;Anyway I thought I'd step back a bit and try to produce some of my own landscapes to start with, and then move onto road generation and finally buildings. Its always nice to start with the easy stuff, that way I find at least I get something done!&lt;br /&gt;
&lt;br /&gt;
Since the actionscript random function generates a new random seed each time a program is run I decided to use a custom random number function which could take a seed. The generator I used is the &lt;a href="http://lab.polygonal.de/2007/04/21/a-good-pseudo-random-number-generator-prng/"&gt;Park-Millar-Carter PRNG&lt;/a&gt;&amp;nbsp;which is ideal for the job. I like the idea of using words (like in the original worms) as seeds so using an input string, eg "Terrain1" and then taking an MD5 hash of it, converting this into a number provided a constant seed for a word. The seed would generate every piece of information in the same way every time, very useful when you find an interesting image.&lt;br /&gt;
&lt;br /&gt;
So I built this in then created several layers of bitmap data, each with different resolution with each pixel on each grid set to a random value (in the range [0,0xFF]). The resulting addition of all the bitmaps would produce the data for my final landscape. Here are a few examples of the kinds of landscapes I was able to produce:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://1.bp.blogspot.com/_uea8fC_rl8A/S2N4eyaE2VI/AAAAAAAAAXg/6u8__j1Br6k/s1600/4.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="134" src="http://1.bp.blogspot.com/_uea8fC_rl8A/S2N4eyaE2VI/AAAAAAAAAXg/6u8__j1Br6k/s200/4.png" width="200" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/S2N4Y7tTVeI/AAAAAAAAAXY/Rf2GOB7trJU/s1600/3.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="135" src="http://4.bp.blogspot.com/_uea8fC_rl8A/S2N4Y7tTVeI/AAAAAAAAAXY/Rf2GOB7trJU/s200/3.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href="http://2.bp.blogspot.com/_uea8fC_rl8A/S2N4LMu4EXI/AAAAAAAAAXI/WJIY4wYTfgo/s1600/EU.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="133" src="http://2.bp.blogspot.com/_uea8fC_rl8A/S2N4LMu4EXI/AAAAAAAAAXI/WJIY4wYTfgo/s200/EU.png" width="200" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/S2N4PGJOS4I/AAAAAAAAAXQ/47gIxq0VzxI/s1600/2.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="133" src="http://4.bp.blogspot.com/_uea8fC_rl8A/S2N4PGJOS4I/AAAAAAAAAXQ/47gIxq0VzxI/s200/2.png" width="200" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To me the third image is a spitting image of europe, with spain, germany and france and even the UK to the very top left! I'm quite happy with the results all in all. To try out the app for yourselves just click&amp;nbsp;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/Terrain.swf?height=400&amp;amp;width=550" rel="prettyPhoto[flash]"&gt;here&lt;/a&gt;, enter a keyword, and press generate!&lt;br /&gt;
&lt;br /&gt;
Next Step, build some roads!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-524819302259648461?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/524819302259648461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/01/terrain-generation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/524819302259648461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/524819302259648461'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/01/terrain-generation.html' title='Terrain Generation'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_uea8fC_rl8A/S2N1WWa2gjI/AAAAAAAAAXA/0TmPii6ulMo/s72-c/2304935268_6e3b92f5f8.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-1363913081969861819</id><published>2010-01-16T09:49:00.000-08:00</published><updated>2010-02-01T09:57:41.482-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='anaglyph'/><category scheme='http://www.blogger.com/atom/ns#' term='ray tracing'/><category scheme='http://www.blogger.com/atom/ns#' term='raytracer'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>Anaglyph Raytracing</title><content type='html'>I made a few changes to the raytracer I've been designing to create anaglyph images, that is two channel 3D images. The changes are very simple, literally two black and white images are drawn from slightly different angles, then one is tinted in cyan, and the other red. I don't have any 3D glasses but it should work. If anyone has some check out the test image below!&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/S1H7xpQaLLI/AAAAAAAAAW4/m8Ezhmyb31E/s1600/Anaglyph.jpg" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_uea8fC_rl8A/S1H7xpQaLLI/AAAAAAAAAW4/m8Ezhmyb31E/s320/Anaglyph.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;I'll try to produce some more images like this and get a pair of glasses to test with. Imagine  realtime anaglyph raytracing!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-1363913081969861819?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/1363913081969861819/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/01/anaglyph-raytracing.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/1363913081969861819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/1363913081969861819'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/01/anaglyph-raytracing.html' title='Anaglyph Raytracing'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uea8fC_rl8A/S1H7xpQaLLI/AAAAAAAAAW4/m8Ezhmyb31E/s72-c/Anaglyph.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-3038673308247770381</id><published>2010-01-10T12:50:00.000-08:00</published><updated>2010-02-01T09:57:15.261-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='books'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>New! - Recommended Books</title><content type='html'>I've got together a list of books related to flash and learning AS3 you might like. These will permanently stay in the right column but right now here are a few of my favourites:&lt;br /&gt;
&lt;br /&gt;
As a general guide to getting started in AS3 the following is great. I would recommend it for beginners though:&lt;br /&gt;
&lt;a href="http://www.amazon.com/gp/product/0596526946?ie=UTF8&amp;amp;tag=experimentali-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=0596526946"&gt;Essential ActionScript 3.0 (Essential)&lt;/a&gt;&lt;img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=experimentali-20&amp;amp;l=as2&amp;amp;o=1&amp;amp;a=0596526946" style="border: none !important; margin: 0px !important;" width="1" /&gt;&lt;br /&gt;
&lt;br /&gt;
For anyone interested in game design this is a fantastic and comprehensive guide:&lt;br /&gt;
&lt;a href="http://www.amazon.com/gp/product/0789737027?ie=UTF8&amp;amp;tag=experimentali-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=0789737027"&gt;ActionScript 3.0 Game Programming University&lt;/a&gt;&lt;img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=experimentali-20&amp;amp;l=as2&amp;amp;o=1&amp;amp;a=0789737027" style="border: none !important; margin: 0px !important;" width="1" /&gt;&lt;br /&gt;
&lt;br /&gt;
More on the theme of this blog one of my favourite books of all time. The Author Phillip Ball discusses connections between the natural world and various mathematical models that describe them. I still find it a great source of inspiration for various experimental flash projects that I have worked on recently!&lt;br /&gt;
&lt;a href="http://www.amazon.com/gp/product/0374530416?ie=UTF8&amp;amp;tag=experimentali-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=0374530416"&gt;Critical Mass: How One Thing Leads to Another&lt;/a&gt;&lt;img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=experimentali-20&amp;amp;l=as2&amp;amp;o=1&amp;amp;a=0374530416" style="border: none !important; margin: 0px !important;" width="1" /&gt;&lt;br /&gt;
&lt;br /&gt;
Like I said from now on there will always be a list of books to the right!&lt;br /&gt;
&lt;br /&gt;
Get reading folks :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-3038673308247770381?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/3038673308247770381/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2010/01/new-recommended-books.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/3038673308247770381'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/3038673308247770381'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2010/01/new-recommended-books.html' title='New! - Recommended Books'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-7804409537702103917</id><published>2009-12-30T16:32:00.000-08:00</published><updated>2009-12-31T10:29:41.288-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><category scheme='http://www.blogger.com/atom/ns#' term='ray tracing'/><category scheme='http://www.blogger.com/atom/ns#' term='raytracer'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><category scheme='http://www.blogger.com/atom/ns#' term='Physics'/><title type='text'>How To Build A Raytracer: Part II</title><content type='html'>In the previous &lt;a href="http://experimentalized.blogspot.com/2009/12/how-to-build-raytracer-part-1.html"&gt;post&lt;/a&gt;&amp;nbsp;we looked at some of the fundamental ideas behind raytracing and saw some stunning renders created using the technique. In this post we'll start to take a look at the camera, and how to create a three dimensional scene.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;The Camera&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
To start with lets create a camera at a position in space [camX,camY,camZ]. This camera can move up, down, left, right, in and out around your scene, and is where all of the initial rays are fired from. The image below shows how the rays exit the camera through the scene. It is clear that we want our rays to pass from the camera through the image, as shown in this diagram, but how do we find these rays! For a horizontal camera with no rotational properties this is actually very easy, so lets take a look at how to do it.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/SzvqpUgMM-I/AAAAAAAAAWw/4gup64-8XoM/s1600-h/800px-Ray_trace_diagram.svg.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_uea8fC_rl8A/SzvqpUgMM-I/AAAAAAAAAWw/4gup64-8XoM/s320/800px-Ray_trace_diagram.svg.png" /&gt;&lt;/a&gt;Traditionally cameras have a property called the field of view. This is related to the range of angles that a camera can see. A fisheye lens, for example, has a large field of view (180 degrees?). High field of views can result in image curving and I've found that the optimum angle between the horizontal and the top vertical for ray tracing is around π/6 degrees giving a field of view of π/3 or 60 degrees.&lt;br /&gt;
&lt;br /&gt;
Once we've decided on a field of view for our ray tracer we can determine the distance between the image plane and the camera. Remember, unless the image is completely square the field of view in the vertical range and the horizontal range will be different. Programmatically, creating a new variable called the scale of view makes things far easier where:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: blue;"&gt;var scaleX:Number = Math.tan(fovX);&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: blue;"&gt;var scaleY:Number = Math.tan(fovY/(scenewidth/sceneheight));&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
In the above actionscript, scene width and scene height are the pixel height and width of the image you want to create. Once we have our scales of view we can start firing rays. In a ray tracer rays are fired through every single pixel in the image. Although it results in pixel perfect images the computation required can also be rather large for high resolutions. This is why ray tracers are not currently used in real time applications.&lt;br /&gt;
&lt;br /&gt;
So the next step in the ray tracing algorithm is to cycle through each pixel creating rays. I suggest using two embedded for loops although there are other ways of doing this depending on the structure of your program:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: blue;"&gt;for(var i:int = 0; i &amp;lt; scenewidth; i++)&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: blue;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;for(var j:int = 0; j&lt;sceneheight; j++)=""&gt;&lt;/sceneheight;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rayX = scaleX*(2*i-scenewidth)/scenewidth;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rayY = scaleY*(2*j-sceneheight)/sceneheight;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;rayZ = 1;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // After we have created the ray we calculate collisions - and then render the pixel&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: blue;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above is a simple example of creating all the rays needed for a scene.&lt;br /&gt;
&lt;br /&gt;
In vector mathematics a lot of calculations rely on the vector being unitary (meaning of length 1). To fix this just take the modulus of (rayX, rayY, rayZ) and divide each of rayX, rayY, and rayZ by this modulus.&lt;br /&gt;
&lt;br /&gt;
This simple model can be extended by adding yaw and pitch, and for the really enthusiastic even roll! These are 3 types of rotation. The simplest way to create rotations is to rotate the ray vectors around the camera's location once they have been generated using matrix transforms. This will fit into a later tutorial.&lt;br /&gt;
&lt;br /&gt;
Stay tuned for the next in the series soon!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-7804409537702103917?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/7804409537702103917/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2009/12/how-to-build-raytracer-part-ii.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/7804409537702103917'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/7804409537702103917'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2009/12/how-to-build-raytracer-part-ii.html' title='How To Build A Raytracer: Part II'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_uea8fC_rl8A/SzvqpUgMM-I/AAAAAAAAAWw/4gup64-8XoM/s72-c/800px-Ray_trace_diagram.svg.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-8959810824335937391</id><published>2009-12-30T09:22:00.000-08:00</published><updated>2009-12-30T09:28:40.453-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><category scheme='http://www.blogger.com/atom/ns#' term='ray tracing'/><category scheme='http://www.blogger.com/atom/ns#' term='raytracer'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><category scheme='http://www.blogger.com/atom/ns#' term='Physics'/><title type='text'>How To Build A Raytracer: Part I</title><content type='html'>This is the first of what I hope to be a few posts that describe the fundamental theories behind building a raytracer. I will specifically look at how to build one in flash using AS3, but the theories should be easily transferrable to any other scripting language so whether you use C++ and openGL, Java, Python or AS3 this set of tutorials will point you in the right direction.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.blogger.com/post-edit.g?blogID=8133808492150620948&amp;amp;postID=8959810824335937391" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" height="240" src="http://4.bp.blogspot.com/_uea8fC_rl8A/SzuJYhFkDgI/AAAAAAAAATc/l2xWBPWNwOU/s320/Render.jpg" width="320" /&gt;&lt;/a&gt;This is not just source code that I'm posting up, I will describe everything that I feel is needed to build a ray tracing engine without necessarily giving too much code. In the end I feel this is a far more rewarding way of learning flash and creating new projects, and is how I have taught myself in the past. Certain aspects of maths throughout the tutorial may be of a reasonable level but most high school vector course books should give enough knowhow to be able to see what is going on. So lets begin.&lt;br /&gt;
&lt;br /&gt;
Note: the image to the right shows the kinds of lighting effects a raytracer can produce.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;What is a raytracer&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
In nature a ray of light travels from a light source - interacts with some objects and either disappears into space or reaches our eyes. What we see depends on what the ray has collided with on the way to our eye. For example taking a light source to be the sun, trillions of rays hit earth every second, each of these reflects, refracts and is absorbed by trees, by roads, by cars and by other people. For us, the onlookers, only a tiny fraction of these rays hit our eyes, but when they do, the individual rays (photons) create the scene we see in front of us on the back of our eyes ready for our brains to untangle and interpret.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=8133808492150620948&amp;amp;postID=8959810824335937391" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_uea8fC_rl8A/SzuJ0ki9uqI/AAAAAAAAATk/IycFPN6NQ2Y/s320/800px-Ray_trace_diagram.svg.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;The idea of a raytracer - at least in the sense of this tutorial - takes what happens in nature and reverses all of the processes. Rays are created in the back of our eyes and are fired in a range of directions at our scene. Each ray passes through a point in our image and will either pass through our scene or hit an object.&amp;nbsp;The image to the left helped me understand the ray firing process. When a ray hits an object there are 3 possibilities:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(i) The ray absorbs the ray&lt;br /&gt;
(ii) The ray reflects the ray&lt;br /&gt;
(iii) The ray refracts the ray&lt;br /&gt;
&lt;br /&gt;
In the first case, a new ray is case from the point where the ray scene collision occurred, in the direction of any light sources in the scene. If there are no objects in the way then the object is lit, otherwise the object is in shadow.&lt;br /&gt;
&lt;br /&gt;
In the second case a new ray can be cast depending on the surface normal of the object which can interact with the scene again. The ray can keep colliding with objects up to an arbitrary number of times so theoretically a ray could bounce between objects forever.&lt;br /&gt;
&lt;br /&gt;
In the third case a new ray can be cast depending on the surface normal and refractive index of the material. As above this ray can continue to interact with the scene.&lt;br /&gt;
&lt;br /&gt;
These three cases are not mutually exclusive. In a scene there can be any amount of refraction, refraction, absorption and shadowing, which gives ray tracers their realism. Take a look at the top image for examples of all three, and the image by pixar below is another example.&lt;br /&gt;
&lt;br /&gt;
We've seen that a raytracer is just a way to render a scene which is physically realistic and can produce effects like shadowing, reflection and refraction in a far simpler way than many other rendering methods.&lt;br /&gt;
&lt;br /&gt;
In my next post I'll explain how the camera works and how to set up our first scene.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=8133808492150620948&amp;amp;postID=8959810824335937391" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_uea8fC_rl8A/SzuLmRhTxxI/AAAAAAAAATs/DW33fqpJS8I/s320/ray-tracing-rasterization,L-Y-214630-13.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-8959810824335937391?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/8959810824335937391/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2009/12/how-to-build-raytracer-part-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/8959810824335937391'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/8959810824335937391'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2009/12/how-to-build-raytracer-part-1.html' title='How To Build A Raytracer: Part I'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uea8fC_rl8A/SzuJYhFkDgI/AAAAAAAAATc/l2xWBPWNwOU/s72-c/Render.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-4147380217073421474</id><published>2009-12-30T04:44:00.000-08:00</published><updated>2009-12-30T09:00:14.229-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fluid dynamics'/><category scheme='http://www.blogger.com/atom/ns#' term='Emergence'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><category scheme='http://www.blogger.com/atom/ns#' term='Physics'/><title type='text'>My Fluid Dynamics Engine in AS3</title><content type='html'>This post and my recent experiments have been inspired largely by the work of Eugene Zatepyakin and that of Jos Stam on fluid dynamics.&lt;br /&gt;
&lt;br /&gt;
Jos Stam's article on &lt;a href="http://www.dgp.toronto.edu/people/stam/reality/Research/pdf/GDC03.pdf"&gt;fluid dynamics for games&lt;/a&gt; started it all, having a similar effect on this area of research as Thomas Jakobsen's article had on the use of Verlet Integration in physics engines. The beauty of the fluid solver is that it provides a computationally quick and stable approach to simulation of fluid dynamics, which can be easily expanded into 3 dimensions and used to solve many more advanced problems.&lt;br /&gt;
&lt;br /&gt;
Eugene Zatepyakin was the next step in the chain creating a fast engine in AS3 which I talked about in a previous &lt;a href="http://experimentalized.blogspot.com/2009/10/fluid-dynamics-using-as3.html"&gt;post&lt;/a&gt;. I decided to write my own version of the engine and here it is:&lt;br /&gt;
&lt;br /&gt;
The first example shows 4000 particles floating around in the simulated fluid - just click on it to launch to flash file - once it is running click and drag to make the fluid move.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/fd1.swf?width=550&amp;amp;height=400" imageanchor="1" rel="prettyPhoto[flash]" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_uea8fC_rl8A/SztJIlQKuvI/AAAAAAAAATM/ICT3v5xZzng/s320/screen1.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: left;"&gt;The second example shows the pressure grid being used as a displacement filter for the image below. This starts to add a bit of realism and creates a more three dimensional feel.&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/fd2.swf?width=550&amp;amp;height=400" imageanchor="1" rel="prettyPhoto[flash]" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_uea8fC_rl8A/SztJOUw-sFI/AAAAAAAAATU/HFwbp56sE9U/s320/screen2.png" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-4147380217073421474?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/4147380217073421474/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2009/12/my-fluid-dynamics-engine-in-as3.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/4147380217073421474'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/4147380217073421474'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2009/12/my-fluid-dynamics-engine-in-as3.html' title='My Fluid Dynamics Engine in AS3'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_uea8fC_rl8A/SztJIlQKuvI/AAAAAAAAATM/ICT3v5xZzng/s72-c/screen1.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-1876198174464072372</id><published>2009-12-16T11:08:00.000-08:00</published><updated>2009-12-19T12:42:44.023-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='ray tracing'/><category scheme='http://www.blogger.com/atom/ns#' term='raytracer'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>Flash Ray Tracer Reflections</title><content type='html'>Finally managed to get reflections properly working in my actionscript raytracer. The mathematics behind reflections is very simple. Given an incoming light ray &lt;b&gt;V&lt;/b&gt;, and a surface normal &lt;b&gt;N&lt;/b&gt;, we can calculate the reflected light ray &lt;b&gt;R&lt;/b&gt; using:&lt;br /&gt;
&lt;br /&gt;
a = &lt;b&gt;V&lt;/b&gt;.&lt;b&gt;N&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;R&lt;/b&gt;&amp;nbsp;= &lt;b&gt;V&lt;/b&gt; + 2*a*&lt;b&gt;N&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
I applied this theory to the ray tracer and the results are beautiful. Its amazing how much realism a few shadows and reflections can create! The number of reflections obviously changes the image realism. The images below show 1, 2 and 3 reflections per ray. Surprisingly there really isn't much of a reduction in performance - and for the purposes of a flash raytracer 3 reflections should be plenty!&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_uea8fC_rl8A/SykvFLo1-pI/AAAAAAAAASE/edRUcnF4QcU/s1600/reflections1pass.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_uea8fC_rl8A/SykvFLo1-pI/AAAAAAAAASE/edRUcnF4QcU/s320/reflections1pass.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_uea8fC_rl8A/SykvPK4y_kI/AAAAAAAAASM/406o-Vo2TJs/s1600/reflection2pass.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_uea8fC_rl8A/SykvPK4y_kI/AAAAAAAAASM/406o-Vo2TJs/s320/reflection2pass.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_uea8fC_rl8A/Sykv78fuo0I/AAAAAAAAASU/8XsCs3vsUa0/s1600/reflections3pass.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_uea8fC_rl8A/Sykv78fuo0I/AAAAAAAAASU/8XsCs3vsUa0/s320/reflections3pass.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Just need to add some functionality for box reflection and then I'll set the engine rendering some nice scenes!&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;One further extension I might set myself is diffuse reflections. Instead of light being reflected directly along the normal, there could be random fluctuations in the reflection vector. I think this could produce quite a nice wave effect. I'll keep you posted!&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;On a performance note the image with 3 reflections took just over 2 minutes to render in 1600x1600 with no real optimisation. For a resolution of 400x400 pixels it takes about 2.5 seconds. Not too bad at all in my opinion!&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Update: Here are a few fuzzy shots. The first one is less fuzzy and the second one is more fuzzy. Quite an interesting effect I think:&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/Syk-kR22xDI/AAAAAAAAASc/0a-a4cLYeIM/s1600/fuzzyreflections.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_uea8fC_rl8A/Syk-kR22xDI/AAAAAAAAASc/0a-a4cLYeIM/s320/fuzzyreflections.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/Syk-wI8YpBI/AAAAAAAAASk/XCgjDtgJD_w/s1600/fuzzyreflections2.png" imageanchor="1" rel="prettyPhoto" style="clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_uea8fC_rl8A/Syk-wI8YpBI/AAAAAAAAASk/XCgjDtgJD_w/s320/fuzzyreflections2.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Decided to go a bit mad and rendered a rather large image with a load of boxes and reflective spheres. Inspired by SuperJers &lt;a href="http://www.superjer.com/pixelmachine/"&gt;PixelMachine&lt;/a&gt;, but rendered completely using flash and AS3, not OpenGL and C++. Here it is (Something has gone wrong with the reflections of the boxes - there is no shadowing - but I didn't have the heart to stop it once it was half way through!):&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/SypMtSOiX5I/AAAAAAAAASs/IZ_T8-GP-aU/s1600/Scene.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_uea8fC_rl8A/SypMtSOiX5I/AAAAAAAAASs/IZ_T8-GP-aU/s320/Scene.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Here is another nice one, 2880 by 2880 pixels, back to the original room but with the reflection stuff added. Looks quite nice in the super high resolution!&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://2.bp.blogspot.com/_uea8fC_rl8A/SyphEuBrANI/AAAAAAAAAS0/Btq2G0Rl-hs/s1600/reflections.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_uea8fC_rl8A/SyphEuBrANI/AAAAAAAAAS0/Btq2G0Rl-hs/s320/reflections.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Update: I've rendered few more large reflective images - there is still something slightly wrong with the reflections I think, check them out:&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://2.bp.blogspot.com/_uea8fC_rl8A/Sy04NjQ0BlI/AAAAAAAAAS8/7GB-6Co_e60/s1600/loadsofspheres2.png" imageanchor="1" rel="prettyPhoto" style="clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_uea8fC_rl8A/Sy04NjQ0BlI/AAAAAAAAAS8/7GB-6Co_e60/s320/loadsofspheres2.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a rel="prettyPhoto" href="http://1.bp.blogspot.com/_uea8fC_rl8A/Sy06mCQZyII/AAAAAAAAATE/HoIj_PcmWUU/s1600/loadsofspheres3.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_uea8fC_rl8A/Sy06mCQZyII/AAAAAAAAATE/HoIj_PcmWUU/s320/loadsofspheres3.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-1876198174464072372?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/1876198174464072372/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2009/12/flash-ray-tracer-reflections.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/1876198174464072372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/1876198174464072372'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2009/12/flash-ray-tracer-reflections.html' title='Flash Ray Tracer Reflections'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_uea8fC_rl8A/SykvFLo1-pI/AAAAAAAAASE/edRUcnF4QcU/s72-c/reflections1pass.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-4635695436056834168</id><published>2009-12-15T09:17:00.000-08:00</published><updated>2009-12-17T07:18:52.622-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='ray tracing'/><category scheme='http://www.blogger.com/atom/ns#' term='raytracer'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>New Raytracer Features</title><content type='html'>I've been working on this now that term is over. The features I've added are diffuse shadows - multiple directional lighting - and box rendering. Here are a few renders. In order they show a low resolution diffuse shadow render, a high resolution render with a cube, and a high resolution render without global lighting with two point lights:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/SyfDulEvIYI/AAAAAAAAAQ8/jQpLJkHP5bs/s1600/diffuse.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_uea8fC_rl8A/SyfDulEvIYI/AAAAAAAAAQ8/jQpLJkHP5bs/s320/diffuse.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/SyfEA_fmQQI/AAAAAAAAARE/6oEtwL2fYjQ/s1600/raytracing.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_uea8fC_rl8A/SyfEA_fmQQI/AAAAAAAAARE/6oEtwL2fYjQ/s320/raytracing.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/SyfEPi__FOI/AAAAAAAAARM/JWNjPe7RROI/s1600/raytracing2.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_uea8fC_rl8A/SyfEPi__FOI/AAAAAAAAARM/JWNjPe7RROI/s320/raytracing2.png" /&gt;&lt;/a&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/SyfEPi__FOI/AAAAAAAAARM/JWNjPe7RROI/s1600/raytracing2.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;br /&gt;
&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/SyfEPi__FOI/AAAAAAAAARM/JWNjPe7RROI/s1600/raytracing2.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;br /&gt;
&lt;/a&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/SyfEPi__FOI/AAAAAAAAARM/JWNjPe7RROI/s1600/raytracing2.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;br /&gt;
&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And here is a render I like with 4 lights:&lt;br /&gt;
&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/SyfK6W7gE3I/AAAAAAAAARk/dwQonVbccp0/s1600/raytracing3.png" imageanchor="1" rel="prettyPhoto" style="clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_uea8fC_rl8A/SyfK6W7gE3I/AAAAAAAAARk/dwQonVbccp0/s320/raytracing3.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Update: Deciding to take the whole concept a bit further and show you that the ray tracer is not just good for rendering spheres and cubes I rendered a really simple office scene of some description - here it is:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_uea8fC_rl8A/SyjwyeQd2PI/AAAAAAAAARs/G72AYpzrPxc/s1600/room1.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_uea8fC_rl8A/SyjwyeQd2PI/AAAAAAAAARs/G72AYpzrPxc/s320/room1.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Update: Finally started looking at reflections. I've got the maths bit of it sorted. Just got to look at the way I'm structuring my code to help it make a bit more sense. Here is my first result, to show that the angles work!&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://2.bp.blogspot.com/_uea8fC_rl8A/SykPU8pTHRI/AAAAAAAAAR0/F0GMVu6EB5g/s1600/reflections1.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_uea8fC_rl8A/SykPU8pTHRI/AAAAAAAAAR0/F0GMVu6EB5g/s320/reflections1.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Update: Same again but this time with 50 or so spheres floating around in the sky - and a reflective floor. Nice to see it almost working!&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://2.bp.blogspot.com/_uea8fC_rl8A/SykYQZ_hZ_I/AAAAAAAAAR8/KyV0ZeR_PuY/s1600/loadsofspheres.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_uea8fC_rl8A/SykYQZ_hZ_I/AAAAAAAAAR8/KyV0ZeR_PuY/s320/loadsofspheres.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-4635695436056834168?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/4635695436056834168/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2009/12/new-raytracer-features.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/4635695436056834168'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/4635695436056834168'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2009/12/new-raytracer-features.html' title='New Raytracer Features'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_uea8fC_rl8A/SyfDulEvIYI/AAAAAAAAAQ8/jQpLJkHP5bs/s72-c/diffuse.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-800317428220856796</id><published>2009-12-15T05:19:00.000-08:00</published><updated>2009-12-15T17:07:31.508-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Mandelbulb'/><category scheme='http://www.blogger.com/atom/ns#' term='mathematics'/><title type='text'>New Scientist Features the Mandelbulb</title><content type='html'>I discovered an article in the latest New Scientist magazine about Daniel White's Mandelbulb. Found it really cool as I've been &lt;a href="http://experimentalized.blogspot.com/2009/11/ray-tracer-in-as3-rendering-mandelbulb.html"&gt;working&lt;/a&gt; on this stuff quite a lot recently! Read the whole article &lt;a href="http://www.newscientist.com/article/dn18171-the-mandelbulb-first-true-3d-image-of-famous-fractal.html"&gt;here&lt;/a&gt; at New Scientist!&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/SyeMNI9ekOI/AAAAAAAAAQ0/iPBIV-GjAoM/s1600/Photo-on-2009-12-15-at-12.58.jpg" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_uea8fC_rl8A/SyeMNI9ekOI/AAAAAAAAAQ0/iPBIV-GjAoM/s320/Photo-on-2009-12-15-at-12.58.jpg" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-800317428220856796?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/800317428220856796/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2009/12/new-scientist-features-mandelbulb.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/800317428220856796'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/800317428220856796'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2009/12/new-scientist-features-mandelbulb.html' title='New Scientist Features the Mandelbulb'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uea8fC_rl8A/SyeMNI9ekOI/AAAAAAAAAQ0/iPBIV-GjAoM/s72-c/Photo-on-2009-12-15-at-12.58.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-2170122347792999818</id><published>2009-12-11T08:38:00.000-08:00</published><updated>2009-12-13T06:50:57.847-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='ray tracing'/><category scheme='http://www.blogger.com/atom/ns#' term='raytracer'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>Quick example of real-time raytracing in flash</title><content type='html'>Just a quick low res, and completely un-optimized example of an animated version of the ray tracer I've been working on. The light source moves in real time and you can move the camera around with the mouse.&lt;br /&gt;
&lt;br /&gt;
Just click the image below to launch it!&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a rel="prettyPhoto[flash]" href="http://experimentalized.com/experimentalized_blog/flsh/RayTracer2-realtime.swf?height=400&amp;width=400" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_uea8fC_rl8A/SyJ0bHyLY0I/AAAAAAAAAQs/GNUN2fIlpMk/s200/Animated+Ray+Tracer.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-2170122347792999818?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/2170122347792999818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2009/12/quick-example-of-real-time-raytracing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/2170122347792999818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/2170122347792999818'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2009/12/quick-example-of-real-time-raytracing.html' title='Quick example of real-time raytracing in flash'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uea8fC_rl8A/SyJ0bHyLY0I/AAAAAAAAAQs/GNUN2fIlpMk/s72-c/Animated+Ray+Tracer.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-7494836522910440104</id><published>2009-12-04T10:16:00.000-08:00</published><updated>2009-12-04T10:17:41.049-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='raytracer'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>Plane Intersections Added to Flash Raytracer</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: left;"&gt;I was working late on this last night when I should have been doing coursework. Anyway I managed to get plane intersections in the AS3. The maths was actually very simple. I'm still working on reflections so stay tuned! Below is a nice example of spheres and planes being rendered. Total time about 15 seconds, 1100 x 800 pixels.&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a rel="prettyPhoto" href="http://2.bp.blogspot.com/_uea8fC_rl8A/SxlRcLLepQI/AAAAAAAAAQk/O3SO_ml3x6Q/s1600/raytracing2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_uea8fC_rl8A/SxlRcLLepQI/AAAAAAAAAQk/O3SO_ml3x6Q/s640/raytracing2.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-7494836522910440104?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/7494836522910440104/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2009/12/plane-intersections-added-to-flash.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/7494836522910440104'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/7494836522910440104'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2009/12/plane-intersections-added-to-flash.html' title='Plane Intersections Added to Flash Raytracer'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_uea8fC_rl8A/SxlRcLLepQI/AAAAAAAAAQk/O3SO_ml3x6Q/s72-c/raytracing2.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-6955939967768758389</id><published>2009-12-01T15:06:00.000-08:00</published><updated>2009-12-04T01:16:44.109-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='raytracer'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>First Screenshots of my AS3 Raytracer</title><content type='html'>&lt;div style="text-align: left;"&gt;After writing a really simple ray tracer to render the Mandelbulb in my &lt;a href="http://experimentalized.blogspot.com/2009/11/ray-tracer-in-as3-rendering-mandelbulb.html"&gt;last post&lt;/a&gt;, I thought I'd write a slightly more advanced one, with more accurate shadows, reflections and all things nice ray tracers have.&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: left;"&gt;I started just getting the raytracer to draw some spheres, but the results weren't very pretty. I added some shadows and some distance based lighting and they began to get a bit better.&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: left;"&gt;Anyway here are the first screenshots. Once I'm at a stage where I'm happy with everything and know that I understand it I'll write a tutorial covering the fundamentals.&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div style="text-align: center;"&gt;&lt;div style="text-align: left;"&gt;First image rendered with shadows - no distance lighting but shadows work&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_uea8fC_rl8A/SxWf_pXcv6I/AAAAAAAAAPs/f0BXTRCCzgE/s1600/raytracing2.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_uea8fC_rl8A/SxWf_pXcv6I/AAAAAAAAAPs/f0BXTRCCzgE/s320/raytracing2.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Another similar example&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/SxWf1fDaq4I/AAAAAAAAAPk/mi9xxBXsjOI/s1600/raytracing.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_uea8fC_rl8A/SxWf1fDaq4I/AAAAAAAAAPk/mi9xxBXsjOI/s320/raytracing.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Trying to get distance decay of lighting intensity but using the wrong vector. This causes brightness where there are more spheres for some weird reason!&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_uea8fC_rl8A/SxWghrPIBVI/AAAAAAAAAP0/0Dkb8ps9dvE/s1600/raytracing3.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_uea8fC_rl8A/SxWghrPIBVI/AAAAAAAAAP0/0Dkb8ps9dvE/s320/raytracing3.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;Fixed it - Shadows look good and added a load more spheres!&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;a href="http://2.bp.blogspot.com/_uea8fC_rl8A/SxWgv7R_dzI/AAAAAAAAAP8/sCXJhx01M1w/s1600/raytracing5.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_uea8fC_rl8A/SxWgv7R_dzI/AAAAAAAAAP8/sCXJhx01M1w/s320/raytracing5.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;I'm starting to like this!&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/SxWg47ShmWI/AAAAAAAAAQE/RoLijTUr56o/s1600/raytracing6.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_uea8fC_rl8A/SxWg47ShmWI/AAAAAAAAAQE/RoLijTUr56o/s320/raytracing6.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;So the next step for this is reflection. This just involves firing another ray when a collision is found and checking for collisions. For those who are interested the resolution is 1100x800 pixels, and the images render in about 5 seconds. Not too bad at all!&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Stay tuned for updates.&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Update: Just a thought, I think altering brightness depending on the direction of the normal of a plane to the light source would increase realism, also create effects like specularity, I don't know but I'll give it a go and post some screens of it!&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Update: Here are a few shots of directional lighting in action! I have to say for such a minor change the realism massively increases. Instead of clear shadow lines, they are all a lot more diffuse! Lovely.&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;A day time shot:&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/SxaQDd0O9UI/AAAAAAAAAQM/McKMBtVrtpQ/s1600/raytracing8.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_uea8fC_rl8A/SxaQDd0O9UI/AAAAAAAAAQM/McKMBtVrtpQ/s320/raytracing8.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;And at night time - with no global illumination:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://2.bp.blogspot.com/_uea8fC_rl8A/SxaQSFKR9TI/AAAAAAAAAQc/Hy9hMsnlMZg/s1600/raytracing11.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_uea8fC_rl8A/SxaQSFKR9TI/AAAAAAAAAQc/Hy9hMsnlMZg/s320/raytracing11.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Update: Just rewrote almost everything, should make it easier to add new features though. Its looking good, nearly got reflections working, then I'll add some other objects (probably boxes and planes).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style="text-align: center;"&gt;&lt;div style="text-align: auto;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: auto;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: auto;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-6955939967768758389?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/6955939967768758389/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2009/12/first-screenshots-of-my-as3-raytracer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6955939967768758389'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/6955939967768758389'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2009/12/first-screenshots-of-my-as3-raytracer.html' title='First Screenshots of my AS3 Raytracer'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_uea8fC_rl8A/SxWf_pXcv6I/AAAAAAAAAPs/f0BXTRCCzgE/s72-c/raytracing2.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-4366581400206551947</id><published>2009-11-26T01:37:00.000-08:00</published><updated>2009-12-13T06:52:24.107-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Mandelbulb'/><category scheme='http://www.blogger.com/atom/ns#' term='ray tracing'/><category scheme='http://www.blogger.com/atom/ns#' term='raytracer'/><category scheme='http://www.blogger.com/atom/ns#' term='mathematics'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>Ray Tracer in AS3: Rendering the Mandelbulb in Flash</title><content type='html'>So I went off for a few hours and thought how I could improve the voxel engine. Both from an efficiency perspective as well as that of realism.&lt;br /&gt;
&lt;br /&gt;
I realised that the only route was ray tracing and after reading this fantastic &lt;a href="http://www.superjer.com/pixelmachine/"&gt;article&lt;/a&gt; by &lt;a href="http://superjer.com/"&gt;SuperJer&lt;/a&gt; about his &lt;a href="http://www.superjer.com/pixelmachine/"&gt;pixel machine experiment&lt;/a&gt;&amp;nbsp;I was motivated and inspired to try something along these lines for my renderer.&lt;br /&gt;
&lt;br /&gt;
The article takes the creation of a ray tracer from its very early stages to a really polished program. All this happens in one weekend by the way, I really suggest you read it.&lt;br /&gt;
&lt;br /&gt;
Anyway the idea behind raytracing is that a ray of light is passed from your camera through a pixel on the screen. The ray formed between the two points continues to pass through your scene until it hits something. When it hits something the pixel through which the ray passed is updated with the colour value of the object it hit, or failing that the colour of the sky behind, and a ray is "fired" through the next pixel until your image is formed.&lt;br /&gt;
&lt;br /&gt;
So in my case I'm trying to render the Mandulbulb set. Something I've now done many times before, but lets be honest, in the past I've needed huge numbers of voxels and the results weren't great. So what happens in the ray tracer?&lt;br /&gt;
&lt;br /&gt;
1. I fire a ray through the current pixel - starting at 0,0 working all the way to the image width/height.&lt;br /&gt;
&lt;br /&gt;
2. I check along the length of the ray to see if that location is a part of the Mandelbulb Set.&lt;br /&gt;
&lt;br /&gt;
3. If it is - check if that point is in light or shade.&lt;br /&gt;
&lt;br /&gt;
4. Fire another ray from this point to my light source.&lt;br /&gt;
&lt;br /&gt;
5. Check a bit away from this point in the direction of the light source, if that point is also a member then any light from the light source would have been stopped. So shadow the pixel.&lt;br /&gt;
&lt;br /&gt;
6. Otherwise colour the pixel normally.&lt;br /&gt;
&lt;br /&gt;
The resulting images that are built up show a lot more detail. Not only that they have pixel perfect shadowing, perspective, rotation and you can't see any stupid voxels.&lt;br /&gt;
&lt;br /&gt;
Lets take a look below at some ray tracing in flash. Below you can see increasing resolutions from&lt;br /&gt;
137 x 100 to 1100 x 800 pixels.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_uea8fC_rl8A/Sw2-8mIGJMI/AAAAAAAAAO0/cdAF5s20Kfs/s400/mandelbrot1.png" /&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_uea8fC_rl8A/Sw2_BWEKADI/AAAAAAAAAO8/zb2ACOJFxZU/s640/mandelbrot2.png" /&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_uea8fC_rl8A/Sw2_G4pWgdI/AAAAAAAAAPE/DKKNw5k2FO4/s640/mandelbrot3.png" /&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_uea8fC_rl8A/Sw2_LMNZ_EI/AAAAAAAAAPM/hF-chcO_Vjw/s640/mandelbrot4.png" /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_uea8fC_rl8A/Sw3C_-c8V_I/AAAAAAAAAPU/QU1qxC4ezrQ/s640/mandelbrot5.png" /&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
And below is one I left to render for about an hour (2200 x 1600 pixels). Just click to enlarge it!&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;a rel="prettyPhoto" href="http://4.bp.blogspot.com/_uea8fC_rl8A/Sw5L9Gk3XgI/AAAAAAAAAPc/pRDfND39mZU/s1600/mandelbrot7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_uea8fC_rl8A/Sw5L9Gk3XgI/AAAAAAAAAPc/pRDfND39mZU/s640/mandelbrot7.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-4366581400206551947?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/4366581400206551947/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2009/11/ray-tracer-in-as3-rendering-mandelbulb.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/4366581400206551947'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/4366581400206551947'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2009/11/ray-tracer-in-as3-rendering-mandelbulb.html' title='Ray Tracer in AS3: Rendering the Mandelbulb in Flash'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uea8fC_rl8A/Sw2-8mIGJMI/AAAAAAAAAO0/cdAF5s20Kfs/s72-c/mandelbrot1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-522860968531696908</id><published>2009-11-24T15:36:00.000-08:00</published><updated>2009-11-24T15:45:20.047-08:00</updated><title type='text'>Radially Coloured Render of 3D Mandelbrot in flash</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: left;"&gt;Just click to enlarge it! Going to start working on volumetric ray-casting for flash next so that we can get some real shadows in there!&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;The colours are produced using the radial term of each point in 3D space. For some reason this actually makes it look like there are shadows being cast which is nice, although there aren't. This really brings out a lot more detail in the render!&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/SwxtslOXM8I/AAAAAAAAAOk/BfTSo_QtNpo/s1600/BIGPURP.gif" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_uea8fC_rl8A/SwxtslOXM8I/AAAAAAAAAOk/BfTSo_QtNpo/s640/BIGPURP.gif" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'Lucida Grande'; font-size: small;"&gt;&lt;span style="font-size: 11px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-522860968531696908?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/522860968531696908/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2009/11/radially-coloured-render-of-3d.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/522860968531696908'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/522860968531696908'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2009/11/radially-coloured-render-of-3d.html' title='Radially Coloured Render of 3D Mandelbrot in flash'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uea8fC_rl8A/SwxtslOXM8I/AAAAAAAAAOk/BfTSo_QtNpo/s72-c/BIGPURP.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-7875105669813773952</id><published>2009-11-22T13:51:00.000-08:00</published><updated>2010-07-07T02:42:57.455-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fractal'/><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='Mandelbulb'/><category scheme='http://www.blogger.com/atom/ns#' term='mathematics'/><category scheme='http://www.blogger.com/atom/ns#' term='Mandelbrot'/><title type='text'>Inverse Mandelbulb Pixel Mapping in Flash</title><content type='html'>&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;When we map the&amp;nbsp;&lt;a href="http://experimentalized.blogspot.com/2009/11/hi-resolution-mandelbrot-renders-from.html"&gt;2d Mandelbrot Set&lt;/a&gt;&amp;nbsp;we normally colour a pixel depending on the rate at which that point tends to infinity on some colour scale. In 3D normally this wouldn't work - where you have solid objects you'd be changing their colour internally. But since we are looking at cross sections using the voxel renderer it is actually very doable. Here are a few examples:&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/SwmvbShPgnI/AAAAAAAAAOE/IajfUugcKrU/s1600/col1.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_uea8fC_rl8A/SwmvbShPgnI/AAAAAAAAAOE/IajfUugcKrU/s320/col1.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;
Remember that the inverse is being mapped. I really like the effect, and its definitely nice to add some colour to the dull grey images of the previous post.&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_uea8fC_rl8A/Swmvs8eSpMI/AAAAAAAAAOM/0tFRihGn9Wk/s1600/col2.png" imageanchor="1" rel="prettyPhoto" style="clear: left; display: inline !important; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_uea8fC_rl8A/Swmvs8eSpMI/AAAAAAAAAOM/0tFRihGn9Wk/s320/col2.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'Lucida Grande'; font-size: small;"&gt;&lt;span style="font-size: 11px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'Lucida Grande'; font-size: small;"&gt;&lt;span style="font-size: 11px;"&gt;&lt;span style="font-family: Times;"&gt;&lt;span style="font-size: medium;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Its like looking into a three dimensional cave of fractal goodness. Another possibility would be to use transparent pixels and change transparency levels. I will give this a go next as it would allow the whole shape to be seen externally, with colour (possibly? we'll see!) &amp;nbsp;Anyway click&amp;nbsp;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/voxeldraw7.swf?height=400&amp;amp;width=550" rel="prettyPhoto[flash]"&gt;here&lt;/a&gt;&amp;nbsp;to see all this fractal goodness happening in real time in flash using AS3! Enjoy&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/Swmx8gmRYQI/AAAAAAAAAOU/O3AUPofTE1o/s1600/col3.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_uea8fC_rl8A/Swmx8gmRYQI/AAAAAAAAAOU/O3AUPofTE1o/s320/col3.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'Lucida Grande'; font-size: small;"&gt;&lt;span style="font-size: 11px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Lucida Grande'; font-size: small;"&gt;&lt;span style="font-size: 11px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Lucida Grande'; font-size: small;"&gt;&lt;span style="font-size: 11px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Lucida Grande'; font-size: small;"&gt;&lt;span style="font-size: 11px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Lucida Grande'; font-size: small;"&gt;&lt;span style="font-size: 11px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/SwmyC9kIkWI/AAAAAAAAAOc/huxnUUwQOS8/s1600/col4.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_uea8fC_rl8A/SwmyC9kIkWI/AAAAAAAAAOc/huxnUUwQOS8/s320/col4.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style="font-family: 'Lucida Grande'; font-size: small;"&gt;&lt;span style="font-size: 11px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-7875105669813773952?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/7875105669813773952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2009/11/inverse-mandelbulb-pixel-mapping-in.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/7875105669813773952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/7875105669813773952'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2009/11/inverse-mandelbulb-pixel-mapping-in.html' title='Inverse Mandelbulb Pixel Mapping in Flash'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uea8fC_rl8A/SwmvbShPgnI/AAAAAAAAAOE/IajfUugcKrU/s72-c/col1.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-5144932736491854559</id><published>2009-11-22T05:41:00.000-08:00</published><updated>2010-07-07T02:42:29.113-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fractal'/><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='Mandelbulb'/><category scheme='http://www.blogger.com/atom/ns#' term='mathematics'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Mandelbrot'/><title type='text'>Working - 3D Mandelbrot in Flash</title><content type='html'>Possibly a world first, I don't know, but I can confirm that I have rendered &lt;a href="http://www.skytopia.com/project/fractal/mandelbulb.html"&gt;Daniel White's&lt;/a&gt; Mandelbulb set using AS3.&lt;br /&gt;
&lt;br /&gt;
The first render is 216 Million voxels (600*600*600) and took about 10 minutes to do.&lt;br /&gt;
&lt;br /&gt;
This is the 8th order of the Mandelbulb (where things start to get interesting from a fractal detail point of view).&lt;br /&gt;
&lt;br /&gt;
First screenshot is half way through the rendering process:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/Swk_BtdtBgI/AAAAAAAAANc/d_gXeFEqcho/s1600/mandelbulb8half.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_uea8fC_rl8A/Swk_BtdtBgI/AAAAAAAAANc/d_gXeFEqcho/s320/mandelbulb8half.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And here is the finished product:&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/Swk_Ij5heVI/AAAAAAAAANk/CoBSr232YrU/s1600/Mandelbulb8.png" imageanchor="1" rel="prettyPhoto" style="clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_uea8fC_rl8A/Swk_Ij5heVI/AAAAAAAAANk/CoBSr232YrU/s320/Mandelbulb8.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Hopefully soon I'll have a 3D Mandelbrot Explorer ready and working much like the &lt;a href="http://experimentalized.blogspot.com/2009/11/ported-mandelbrot-explorer-for-flash.html"&gt;2d version&lt;/a&gt; previously. I'm currently rendering an image 1000x1000x1000 voxels in size (1 Gigavoxel), and I'll add it to this post when it comes out!&lt;br /&gt;
&lt;br /&gt;
edit: here is the gigavoxel render (zoomed in a bit too much though which I'm annoyed about so it cut off the "colosseum" structure at the top!&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/SwlS_lISJvI/AAAAAAAAANs/D-TRsjIH8HY/s1600/GIGA.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_uea8fC_rl8A/SwlS_lISJvI/AAAAAAAAANs/D-TRsjIH8HY/s640/GIGA.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://experimentalized.com/experimentalized_blog/flsh/voxeldraw5.swf?height=400&amp;amp;width=550" rel="prettyPhoto[flash]"&gt;here&lt;/a&gt; is a quick preview of the voxel engine rendering a lower resolution (400x400x400) version.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;To zoom in at the moment you'll just have to right click and press "zoom in" but this won't actually zoom in, just give you can enlarged version. Worth doing if you want to see individual voxels though :)&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Enjoy!&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;edit: Just started playing with zooming and rotating:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Here is a view of the colosseum structure (normally at the top) from the side:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;a href="http://1.bp.blogspot.com/_uea8fC_rl8A/SwlqfaKA-xI/AAAAAAAAAN8/eQBpa5tXHcI/s1600/colloseum.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_uea8fC_rl8A/SwlqfaKA-xI/AAAAAAAAAN8/eQBpa5tXHcI/s320/colloseum.png" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-5144932736491854559?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/5144932736491854559/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2009/11/working-3d-mandelbrot-in-flash.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/5144932736491854559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/5144932736491854559'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2009/11/working-3d-mandelbrot-in-flash.html' title='Working - 3D Mandelbrot in Flash'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_uea8fC_rl8A/Swk_BtdtBgI/AAAAAAAAANc/d_gXeFEqcho/s72-c/mandelbulb8half.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-1462208443424031787</id><published>2009-11-18T07:19:00.000-08:00</published><updated>2009-12-13T06:51:33.601-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='Mandelbulb'/><category scheme='http://www.blogger.com/atom/ns#' term='mathematics'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>First Demo of the Mandelbulb in flash.</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: left;"&gt;So I've put together a demo of the Voxel Renderer doing something - not entirely sure if it is the true Mandelbrot in 3d - but &amp;nbsp;click the image below to see the approach I'm taking -&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Zoom in and you'll see how it's constructed from isometric cubes.&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a rel="prettyPhoto[flash]" href="http://experimentalized.com/experimentalized_blog/flsh/voxeldraw3.swf?height=400&amp;width=550" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_uea8fC_rl8A/SwQPoc8qNQI/AAAAAAAAANU/ZKNMg5diAgE/s320/mbs.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-1462208443424031787?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/1462208443424031787/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2009/11/first-demo-of-mandelbulb-in-flash.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/1462208443424031787'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/1462208443424031787'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2009/11/first-demo-of-mandelbulb-in-flash.html' title='First Demo of the Mandelbulb in flash.'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_uea8fC_rl8A/SwQPoc8qNQI/AAAAAAAAANU/ZKNMg5diAgE/s72-c/mbs.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-2771800477237533376</id><published>2009-11-17T15:39:00.000-08:00</published><updated>2009-11-18T01:37:48.977-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='Mandelbulb'/><category scheme='http://www.blogger.com/atom/ns#' term='mathematics'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><category scheme='http://www.blogger.com/atom/ns#' term='Voxel'/><category scheme='http://www.blogger.com/atom/ns#' term='Mandelbrot'/><title type='text'>Mandelbulb - First Thoughts</title><content type='html'>In light of &lt;a href="http://harryseldon.thinkosphere.com/"&gt;Harry's&lt;/a&gt; comment I thought I'd take a look at trying to code a &lt;a href="http://www.skytopia.com/project/fractal/mandelbulb.html"&gt;Mandelbulb&lt;/a&gt; set.&lt;br /&gt;
&lt;br /&gt;
The first obstacle was how to render:&lt;br /&gt;
&lt;br /&gt;
The examples I've seen mainly use ray tracing - there is no way as3 is capable of raytracing this kind of complexity within my lifetime. I decided to write a simple voxel (3D pixel) engine to display the set. The theory behind this is fairly simple. Work in isometry (no perspective), render from left to right, bottom to top and front to back and all should work out.&lt;br /&gt;
&lt;br /&gt;
Just so I knew the kinds of things I was looking for here are a few of Daniel Whites original renders of the Mandelbulb.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="align: left;"&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/SwMwoZ9kt_I/AAAAAAAAAMc/LwkNmC0YGVs/s1600/whole-small.jpg" rel="prettyPhoto" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img height="290px" src="http://3.bp.blogspot.com/_uea8fC_rl8A/SwMwoZ9kt_I/AAAAAAAAAMc/LwkNmC0YGVs/s1600/whole-small.jpg" width="290px" /&gt;&lt;/a&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/SwMwtEeC6DI/AAAAAAAAAMk/uTc3gC-V87E/s1600/honeycomb-heaven-small.jpg" rel="prettyPhoto"&gt;&lt;img height="290px" src="http://4.bp.blogspot.com/_uea8fC_rl8A/SwMwtEeC6DI/AAAAAAAAAMk/uTc3gC-V87E/s1600/honeycomb-heaven-small.jpg" width="290px" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div style="align: right;"&gt;So quite something to aim for with flash!&lt;br /&gt;
&lt;br /&gt;
Anyway, I thought I'd start BIG, and by BIG I probably mean I regret doing it now because of the insane render time. Poor flash player.&lt;br /&gt;
&lt;br /&gt;
As I write this the whole render (1000x1000x1000 - 1 million voxels - 1 mega voxel!) is about 2 percent complete. I don't know whether what I am rendering is the right thing or not but hopefully as more shapes begin to unveil themselves it will become clear and I'll know whether to start again or not!&lt;br /&gt;
&lt;br /&gt;
Here are a few renders using the Voxel Engine:&lt;br /&gt;
&lt;br /&gt;
The first few cross-sections - some potential? We'll see..&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_uea8fC_rl8A/SwMzOv-eQqI/AAAAAAAAAMs/8KZG5H1f89Y/s1600/voxel1.png" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_uea8fC_rl8A/SwMzOv-eQqI/AAAAAAAAAMs/8KZG5H1f89Y/s400/voxel1.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;About 10 cross-sections down - only 990 to go! There are some interesting shapes going on though - note this is a zoom. You can see the individual voxels and how I build them up quite nicely. There does seem to be an awfully regular plane forming which shouldn't be there.&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;a href="http://1.bp.blogspot.com/_uea8fC_rl8A/SwMzizF4trI/AAAAAAAAAM0/GiZLH9nWN3Y/s1600/voxel2.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_uea8fC_rl8A/SwMzizF4trI/AAAAAAAAAM0/GiZLH9nWN3Y/s320/voxel2.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Yet more complete - starting to get some nice inwards curving - hopefully it will make a shape thats kind of spherical...&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/SwMz2p-fyoI/AAAAAAAAAM8/5QLzCutNTh0/s1600/voxel3.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_uea8fC_rl8A/SwMz2p-fyoI/AAAAAAAAAM8/5QLzCutNTh0/s320/voxel3.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;Just a bit more - about an hour down and the stage I go to bed at! I'll take another look in the morning - until then good night!&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;a href="http://1.bp.blogspot.com/_uea8fC_rl8A/SwM0Cx4U-SI/AAAAAAAAANE/j5oT8LtkUKw/s1600/voxel4.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_uea8fC_rl8A/SwM0Cx4U-SI/AAAAAAAAANE/j5oT8LtkUKw/s320/voxel4.png" /&gt;&lt;/a&gt;&lt;br /&gt;
Below is what I found the next morning: Not exactly what I was looking for - fractal? possibly - but not nearly as complex as the Mandelbrot I should have been getting.&lt;br /&gt;
&lt;a href="http://1.bp.blogspot.com/_uea8fC_rl8A/SwO_8NoPcCI/AAAAAAAAANM/gpzIRXKN5AU/s1600/voxel5.png" imageanchor="1" style="clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_uea8fC_rl8A/SwO_8NoPcCI/AAAAAAAAANM/gpzIRXKN5AU/s320/voxel5.png" /&gt;&lt;/a&gt;&lt;br /&gt;
Unfortunately this means I'll have to change the settings and start over: at least I know the Voxel Engine works, and that I shouldn't do quite as ambitious renders! I'll keep you updated on the results!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-2771800477237533376?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/2771800477237533376/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2009/11/mandelbulb-first-thoughts.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/2771800477237533376'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/2771800477237533376'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2009/11/mandelbulb-first-thoughts.html' title='Mandelbulb - First Thoughts'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_uea8fC_rl8A/SwMwoZ9kt_I/AAAAAAAAAMc/LwkNmC0YGVs/s72-c/whole-small.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-9055514576897972336</id><published>2009-11-11T10:34:00.000-08:00</published><updated>2009-12-02T02:50:45.848-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mathematics'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><category scheme='http://www.blogger.com/atom/ns#' term='Mandelbrot'/><category scheme='http://www.blogger.com/atom/ns#' term='image encoding'/><title type='text'>Ported Mandelbrot Explorer for Flash AS3</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: left;"&gt;Hi everyone - I've got some very very exciting news!&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
I've made a flash version of the project I've been working on at uni with export functionality.&lt;br /&gt;
&lt;br /&gt;
Click &lt;a href="http://experimentalized.com/experimentalized_blog/flsh/MandelbrotFlashExporter.swf?height=300&amp;amp;width=300" rel="prettyPhoto[flash]"&gt;here&lt;/a&gt; to launch it&lt;br /&gt;
&lt;br /&gt;
The features list is as follows:&lt;br /&gt;
&lt;br /&gt;
Colour Settings&lt;br /&gt;
&amp;nbsp;-&amp;gt; Red, Green, Blue&lt;br /&gt;
&amp;nbsp;-&amp;gt; Greyscale&lt;br /&gt;
&amp;nbsp;-&amp;gt; 3 types of multicoloured rendering&lt;br /&gt;
&lt;br /&gt;
Form Settings&lt;br /&gt;
&amp;nbsp;-&amp;gt; Classic Mandelbrot&lt;br /&gt;
&amp;nbsp;-&amp;gt; Conjugate Mandelbrot&lt;br /&gt;
&amp;nbsp;-&amp;gt; Absolute Mandelbrot&lt;br /&gt;
&amp;nbsp;-&amp;gt; Imaginary Absolute Mandelbrot&lt;br /&gt;
&amp;nbsp;-&amp;gt; Real Mandelbrot&lt;br /&gt;
&lt;br /&gt;
Dimension Settings&lt;br /&gt;
&amp;nbsp;-&amp;gt; 2,3,4,5,6&lt;br /&gt;
&lt;br /&gt;
Preview Image&lt;br /&gt;
&amp;nbsp;-&amp;gt; 150px by 120px&lt;br /&gt;
&lt;br /&gt;
Output Image&lt;br /&gt;
&amp;nbsp;-&amp;gt; png format&lt;br /&gt;
&amp;nbsp;-&amp;gt; 400-2000 width, 300-2000 height&lt;br /&gt;
&lt;br /&gt;
Panning and Zoom - outputted location to interface.&lt;br /&gt;
&lt;br /&gt;
Rendering is never more than about 20seconds even for 2000x2000 pixels on my 2GHz 2GB iMac which is pretty good considering its flash!&lt;br /&gt;
&lt;br /&gt;
Here is a little render of a Burning Ship Fractal at (-1.88480,&amp;nbsp;-0.00041) with a zoom of&amp;nbsp;126988x. Just click to view it full size!&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/SvsDe_EGNSI/AAAAAAAAAMM/VB7eVDm6F-E/s1600/mandelbrot.jpg" imageanchor="1" rel="prettyPhoto" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_uea8fC_rl8A/SvsDe_EGNSI/AAAAAAAAAMM/VB7eVDm6F-E/s200/mandelbrot.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-9055514576897972336?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/9055514576897972336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2009/11/ported-mandelbrot-explorer-for-flash.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/9055514576897972336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/9055514576897972336'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2009/11/ported-mandelbrot-explorer-for-flash.html' title='Ported Mandelbrot Explorer for Flash AS3'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_uea8fC_rl8A/SvsDe_EGNSI/AAAAAAAAAMM/VB7eVDm6F-E/s72-c/mandelbrot.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-2257767576059706110</id><published>2009-11-09T13:52:00.000-08:00</published><updated>2009-12-02T02:50:12.428-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mathematics'/><category scheme='http://www.blogger.com/atom/ns#' term='Mandelbrot'/><category scheme='http://www.blogger.com/atom/ns#' term='youtube'/><title type='text'>Outward zoom of embossed fractal!</title><content type='html'>Just a quick animation from the application and exported with emboss settings - only 35 frames but you get the idea!&lt;br /&gt;
&lt;br /&gt;
&lt;object height="344" width="425"&gt;&lt;param name="movie" value="http://www.youtube.com/v/ZUB0EyCTLOQ&amp;hl=en&amp;fs=1&amp;"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/ZUB0EyCTLOQ&amp;hl=en&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-2257767576059706110?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/2257767576059706110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2009/11/outward-zoom-of-embossed-fractal.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/2257767576059706110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/2257767576059706110'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2009/11/outward-zoom-of-embossed-fractal.html' title='Outward zoom of embossed fractal!'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-4819105973436307884</id><published>2009-11-09T13:28:00.000-08:00</published><updated>2009-12-02T02:49:47.301-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mathematics'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><category scheme='http://www.blogger.com/atom/ns#' term='Mandelbrot'/><title type='text'>Hi Resolution Mandelbrot Renders - from the Mandelbrot Explorer</title><content type='html'>Here are four hi-res images of outputs from my new piece of software - Mandelbrot explorer. The software normally only runs on Windows - but I managed to get it working on my Mac at home using WINE and thought I'd upload some images with various render settings!&lt;br /&gt;
&lt;br /&gt;
Without any further ado - here they are:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_uea8fC_rl8A/SvhXVvDRfDI/AAAAAAAAALk/3_xgCWkt9xE/s1600/burningship1.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_uea8fC_rl8A/SvhXVvDRfDI/AAAAAAAAALk/3_xgCWkt9xE/s200/burningship1.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/SvhXjq1H_3I/AAAAAAAAALs/nrp6p0gBFuM/s1600/absim.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_uea8fC_rl8A/SvhXjq1H_3I/AAAAAAAAALs/nrp6p0gBFuM/s200/absim.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_uea8fC_rl8A/SvhXt6Z-PJI/AAAAAAAAAL8/dN-ZSrgUb4c/s1600/mb.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_uea8fC_rl8A/SvhXt6Z-PJI/AAAAAAAAAL8/dN-ZSrgUb4c/s200/mb.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_uea8fC_rl8A/SvhXpDR4oAI/AAAAAAAAAL0/nsb1nWwxjdE/s1600/rivers.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_uea8fC_rl8A/SvhXpDR4oAI/AAAAAAAAAL0/nsb1nWwxjdE/s200/rivers.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_uea8fC_rl8A/SviLi0Sss_I/AAAAAAAAAME/WWV-1tcOIbc/s1600/spiral.png" imageanchor="1" rel="prettyPhoto" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="133" src="http://2.bp.blogspot.com/_uea8fC_rl8A/SviLi0Sss_I/AAAAAAAAAME/WWV-1tcOIbc/s200/spiral.png" width="200" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Enjoy their high-def beauty!&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Again - if you want the app just send me an email!&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-4819105973436307884?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/4819105973436307884/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2009/11/hi-resolution-mandelbrot-renders-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/4819105973436307884'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/4819105973436307884'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2009/11/hi-resolution-mandelbrot-renders-from.html' title='Hi Resolution Mandelbrot Renders - from the Mandelbrot Explorer'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_uea8fC_rl8A/SvhXVvDRfDI/AAAAAAAAALk/3_xgCWkt9xE/s72-c/burningship1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8133808492150620948.post-1431509812339110573</id><published>2009-11-08T07:28:00.000-08:00</published><updated>2009-12-02T02:49:20.803-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='flash games'/><category scheme='http://www.blogger.com/atom/ns#' term='AS3'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><category scheme='http://www.blogger.com/atom/ns#' term='Physics'/><title type='text'>String Thing</title><content type='html'>Just created my entry for the Mochiads 60 second game design contest, its called String Thing - let me know what you think. Just click the thumbnail below to launch the game!&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://games.mochiads.com/c/g/string-thing/String%20Thing.swf?height=400&amp;amp;width=550" rel="prettyPhoto[flash]"&gt;&lt;img src="https://sandbox.mochiads.com/c/g/string-thing/_thumb_100x100.jpg"/&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8133808492150620948-1431509812339110573?l=experimentalized.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://experimentalized.blogspot.com/feeds/1431509812339110573/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://experimentalized.blogspot.com/2009/11/string-thing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/1431509812339110573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8133808492150620948/posts/default/1431509812339110573'/><link rel='alternate' type='text/html' href='http://experimentalized.blogspot.com/2009/11/string-thing.html' title='String Thing'/><author><name>Sam Halliday</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_uea8fC_rl8A/SgXC1XNRjMI/AAAAAAAAAAM/WaxwGoD6q2c/S220/SDC10618.jpg'/></author><thr:total>0</thr:total></entry></feed>
