Posted on November 20, 2009 by Grant SkinnerI just uploaded an update to the Wander motion class I released a couple weeks ago. This version has some new features that I’ve added as I needed them, like:
Here’s a simple demo that uses targetObject and rotationLimit. It’s included in the download. It shows 200 wandering sprites with rotation limits following another sprite with a high varyRotation setting and no rotationLimit. AC_FL_RunContent( 'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0', 'width', '550', 'height', '550', 'src', '/blog/assets/WanderFollow', 'quality', 'high', 'pluginspage', 'http://www.adobe.com/go/getflashplayer', 'align', 'middle', 'play', 'true', 'loop', 'true', 'scale', 'showall', 'wmode', 'window', 'devicefont', 'false', 'id', 'WanderFollow', 'bgcolor', '#FFFFFF', 'name', 'WanderFollow', 'menu', 'true', 'allowFullScreen', 'true', 'allowScriptAccess','sameDomain', 'movie', '/blog/assets/WanderFollow', 'salign', '' ); //end AC code You can download the updated version, with docs and demos by clicking here.
Follow @gskinner on Twitter for more news and views on interactive media.
|
|
|
10 Comments
Very Cool! Thanks for sharing this, I hope to have an opportunity to use this real soon. I'll share when I do.
Posted by: Evan Mullins on Nov 23, 2009 10:39am URL: http://circlecube.com
Nice work.
Does it have a 3D interface to use in away3d, PV3D etc?
Would it be easy enough to implement a z coordinate if you haven't already?
Posted by: Max on Nov 23, 2009 8:18pm
Didn't realise I had already posted this question previously, but I did a quick google and saw these 3d flocking articles:
http://blog.inspirit.ru/?p=231
http://blog.onebyonedesign.com/?p=282
Posted by: Max on Nov 23, 2009 8:28pm
wow, nice job!
Posted by: aex on Nov 24, 2009 3:46pm URL: http://h43x.com/
Hi, awesome work you made here. Like always :D
One question... Is there an easy way set the initial rotation/direction for particles? At this moment they all go to the right at start.
Posted by: wickedpixel on Dec 22, 2009 2:34pm
eh, well.. nevermind... i need to read better the manual. targetRotation was for that.
:facepalm:
Posted by: wickedpixel on Dec 22, 2009 3:05pm
...now i'm spaming :)
What i needed was to do create particles like this:
wander = new Wander(clip,{params...});
wander.target.rotation = degree.
where degree is the initial direction for the wander particles, in degrees. default is 0.
ok. now i'm gone for good.
Posted by: wickedpixel on Dec 22, 2009 3:19pm
wickedpixel - right, the Wander class will use the rotation of the target. So as you said, it's just:
clip.rotation = initialRotation;
wander = new Wander(clip, ...);
Posted by: Grant Skinner on Dec 22, 2009 7:07pm URL: http://gskinner.com/blog/
2 ice
Posted by: news on Dec 20, 2011 2:58am URL: http://www.reddit.com
Hey.
I've known this class existed for a long time but today I got a reason to use it. Yay!
Just a minor thing. The props object initializer ("null") indicates you don't have to pass an object, but you do, otherwise this line causes error:
if (!(autoUpdate in props)) { props.autoUpdate = true; }
cheers
Posted by: Mattias Hallqvist on Apr 18, 2012 3:58pm URL: http://www.nook.se