Bartek Drozdz kicked off modifiers by building the Bend modifier. Andy Zupko then followed up with a Twist modifier. They are wonderful little tools. Now to figure out a way to implement them into my web projects. >-)
Bend & Twist Modifier
example: Modifiers
source: Bend & Twist Modifier Example
requirements: Bend Modifier Class / Twist Modifier Class
//import the Bend and Twist Modifiers
import com.everydayflash.pv3d.modifiers.Bend;
import com.everydayflash.pv3d.modifiers.Twist;
//declare a Bend and Twist variable along with an object to apply the modifiers to
private var bend:Bend;
private var twist:Twist;
private var plane:Plane;
private var plane2:Plane;
//next you will need to instantiate your planes
//after that, instantiate your modifiers and pass the plane you wish to apply the modifier as a parameter
bend = new Bend(plane);
twist = new Twist(plane2);
//then, inside your enterframe handler render the modifier effect
bend.bend(Bend.X, Bend.Z, mouseX/stage.width * 2, .5);
twist.twist(mouseX * (1/3), new Number3D(0, 1, 0), new Number3D(0, 0, 0));
Please note that the sample files are meant to be generated with Flex. If you don't have Flex you can remove the [SWF] metadata and then apply the .as file as a document class to a new fla and publish. The Modifiers are required (duh!) as well. Be sure to download those and add them to your library.
Hi, the example isn't working! (Firefox)
I've noticed that Firefox has been having trouble viewing straight up .swf url's. View this example in IE. Not a big deal but I'd need to wrap the swf in an html file to make it viewable in firefox.
hi, i cant see any of your examples, always "bad request"....
Bad Request (Invalid Hostname)
can you help me please?
masuno
Hey there, any way of stacking bends on an plane? I'm trying to make an origami application and just want to test the strength of the script.
Thanks
Thats probably a questions for Bartek Drozdz (the creator of the Bend Modifier). Since this post, he has come out with "AS3DMod". Which is a modifier stack class. You might look into that. It is a longer term solution.
Here is the link: http://www.everydayflash.com/blog/index.php/2008/09/03/as3dmod/