Succumbed to Twitter :S

February 13th 2009

http://twitter.com/mrdoob

I think it's a interesting way for logging dev progress and save useful links.

Thanks... ;)

no comments

Legal Age Verification with Actionscript

February 9th 2009

Here it's a quick snippet I had to do for this site I'm working on...

I did a quick google search to see if there was a snippet for it already but didn't find anything so I though I would share it here. I though it was going to be a nightmare job but ended up quite simple:

var legalAge : int = 18; // or 21
			
var userDOB : Date = new Date(year,month-1,day);
var today : Date = new Date();
			
var diff : Date = new Date();
diff.setTime( today.getTime() - userDOB.getTime() );
			
var userAge : int = diff.getFullYear() - 1970;
			
if (userAge >= legalAge)
	trace("lets get pissed!");	
else
	trace("go away!");


6 comments

Papervision3D Previewer 1.3

February 1st 2009

Trent Grover from iMed Studios missed some features and went ahead and did them himself. Once done he shared the code. I say, way to go! ;)



Here is the list of his changes:

  • updating to compile against PV3D public beta 2 (updated from svn on 09/02/01)
  • rewrote the camera system (too much has changed, but ends up simpler)
  • included loading for more model types (DAE, Ase, 3ds, kmz, MD2)
  • added animation playback for DAE and MD2 files
  • added model scale change via up and down arrow keys
  • mouse click selects current mesh for scale change

I cleaned the code (my part mostly) and made it FDT friendly. While at it I also cleaned the repository a bit.

5 comments

Omega Code

January 8th 2009



More audio visualisers! Yeey!

Early December last year Marcelo invited me to join his Omega Code project where lots a visual artist were going to create a illustration/poster for each of the track on the band's first album.

My take on the project would be creating a visualiser for the website. Although at first I planned to create a tool to get some curves to match each track (which is something I want to do this year) I ended up running out of time and had to go back on trying to get the best out of the FFT.

On top of that, ever since the first time Ithaqua quickly explained on a random forum (spanish) his way of animating octopus-ish meshes in 3D I always wanted to implement it and this time, and as most of the posters were quite circular, this seemed to be a good opportunity.

If you're wondering how have it's done here it's a quick explanation. Imagine having 20 spheres each one slightly bigger than the previous one; all of the centred. Now hide them and draw lines from each point in between each sphere. That would be a line from the point 0 of the sphere 0 to the point 0 of the sphere 1 and so on. You'll end up with a hair ball. Unfortunatelly, the drawing API of flash is a bit slow and it will be a hair ball of 20 or so hairs. From there you should be able to guess the rest :)



Once the effect was done, it was a matter of spending a lot of hours tweaking parameters, testing with different tunes, and finally quickly integrating it with the website interface developed by scarpelini.

I hope you find the end result as mesmerising as I do :)

11 comments

Wonderfl++

January 5th 2009

Since the last post about Wonderfl I've added a couple of new snippets. Some of them are forks of old effects and some others are effects I had somewhere on my HD.















Enjoy the sources! ;)

5 comments

Wonderfl: coding + compiling Actionscript inside the browser

December 17th 2008

These Japanese are crazy... The last thing they've managed to do is to embed a Actionscript compiler right inside the browser. On top of that the site has basic community features where you can code your own snippets and remix other people's.

http://wonderfl.kayac.com/

Coding on that window is a bit tricky, but it was fun, somehow. I wonder how the project will end up.

I added some of my snippets on my profile:

http://wonderfl.kayac.com/user/mrdoob

2 comments

Google's Native Client

December 9th 2008



http://code.google.com/p/nativeclient/

Is it me, or this one looks like a serious flash killer? (And I actually hate when people use that [product]killer word combination).

Seriously... Specially now that Actionscript 3 has become quite dev-only thing. If google can make this one work, I can only see trouble for Adobe.

EDIT: I'm pasting here a email I've sent to the internal Hi-ReS! list which extends a bit this post:

Basically, this is a double kick.

First to Microsoft for trying to compete with Flash player by copying the worst side of it (scripting language).

Second to flash, because the whole community is always complaining how bad optimised the player is and how slow it is still compared to OS based applications. You know, compare flash earth with... redbull earth.

This is just opening a door to all the C/C++ Graphic programmers out there to the web. Letting them use what they know (C/C++) to create application/experiences/experiments viewable from any browser. (As long as they have the plugin and/or use Google Chrome).

Processing uses Java, and people that weren't happy (with flash performance) moved to Processing/Java in order to have richer visuals on the web. Java hasn't really been doing well online, the applet is annoying most of the time and takes a lot of time to load (and shows a ugly loader). This even beats that.

It is, of course, not going to be a night/day change, but I think this has way too much potential if they handle it well. I still don't know if it's sofware-rendering only.

And hey! They have Quake already, and flash (publicly) doesn't!


no comments

Yet another webcam effect: LSD

December 4th 2008



Is not at all the effect I was trying to do, but it ended up quite decent too. I'll keep trying... Until then, enjoy the trip :D

Source file.

UPDATE: I've changed a bit the .as (and the .swf) so it checks if there is a webcam available. I guess I should update someday all the other examples...

6 comments

DuplicateMovieClip with AS3 (not Senocular's way)

December 1st 2008

I've been trying to use Senocular's duplicateDisplayObject() for a while and I've experienced a lot of crashes of specific versions of Flash player and also unsuccessful results when used within an AIR application. After playing around quite a bit with all this, the best way I've found is to avoid duplicating the instance but duplicate the element on the domain/library instead.

I'm pasting here a snippet of how it works:

/*
 * node.@src example: file:///home/[username]/Desktop/[project]/files/assets/home/ball.swf
 * Cache.get() its basically a Dictionary where I store all the externally loaded files using the url as keys
 */

var mc : DisplayObject = Cache.get( node.@src );

var pathArray : Array = String( node.@src ).split( "/" );
var filename : String = String( pathArray[ pathArray.length - 1 ] ).split( "." )[0];  

if ( mc.loaderInfo.applicationDomain.hasDefinition( filename ))
	mc = new ( mc.loaderInfo.applicationDomain.getDefinition( filename ))();

mc is now a clean duplication (as far as I know) of the original class. In my setup I expect the element that I want to be duplicated be named with the exact name as its container's filename (.swf), which is perfect for FlexSDK compiled stuff, but need some teaching for Flash IDE.

This is, of course, compatible with any kind of Object (not only MovieClips/Sprites/DisplayObjects)...

8 comments

Showcase is back, now in Javascript

November 19th 2008

It was about time to put the showcase on the homepage again. When I released it first time it worked more or less fine for a month and then Firefox released a new version that made the site very buggy. At the point it was a flash menu that when clicked setted the URL address with swfaddress and loaded the actual link on a iframe. That double action code seemed to be a bit of a problem.

http://mrdoob.com/

This time it's a mix of PHP5 and Javascript. It's my first time with PHP5, but SimpleXML was very easy to get used to. In half an hour the PHP was reading the xml and creating the structure. On the Javascript side, I have already tested jQuery before, so I wanted to give it a try to MooTools. I liked the fact that once you're done you can create your own .js file with the things you are really using. This one took more time, but in the end it was also very simple, just take a look at the code.

This time doesn't use the #/XX style links, it reloads the menu every time you select an item, but I've done my best to keep it very small and also it would get cached anyway. It is still not finished, still have to put the source links and visited links graphic but the base is there.

Browser Testing time...

I developed it on Firefox/Linux, and I noticed it was a bit choppy sometimes. Specially when the swf piece at the bottom is a bit cpu heavy. Interestingly enough this didn't happen when it was 2 swf, I guess the vm is doing some magic there. Once it was finished I tried it on IE7/Windows first thing, and for my surprise the layout was all perfect (!!!), although the click didn't work too well, I'll work on it other day. Then on Chrome/Windows everything seems to be just perfect, no chopy animation at any point. I still have to try it on Safari but I got the feeling the results will be like on Chrome. Opera/Linux is the worst in this case, when mouseovering the menu items the swf just stops. Ha.

If it doesn't behave nicely in your browser, feel free to email me with the details and I'll see what I can do. :)

no comments
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
Some of the projects that I worked on.



Some of the HTML5 and Actionscript experiments I've done.