Papervision AS3DMod – modifier for 3D Flash
Thursday, September 04th, 2008 | Author: dehash
Interested to see this appear yesterday at everydayflash.com and made a quick start on a sandbox for it to get ideas on how to use it with Papervision.
A first example of AS3DMod which is a sandbox to experiment with can be found here.
Updates: Some usage tips noted for the initial version of the library using pv3d
* Seems to work fine with current SVN build of PV3D
* in com.as3dmod.modifiers.Noise.as comment out line 9:
import alternativa.types.Matrix3D; (the import is not used but will error if you only have pv3d library)
* Grab com.carlcalderon.arthropod.Debug.as from here and put it in your path as it is used in several of the files.
* Added simplfied usage code to the example here
* Added examples below using svn build.
Noise – sandpaper to mountain range: AS3DModNoise.as
Taper- rip and shrink: AS3DModTaper.as



Great to see someone using the library, and its even better to see it the next day after it was published!
Thanks a lot
Bartek
Thank you for the library Bartek. It is good to have things like that to experiment with.
i am having big trouble implementing “bloat” modifier/do you have any examples w/code? i would appreciate any help (the parameter or argument of “radius” with this modifier keeps throwing an error(“1119: Access of possibly undefined property radius through a reference with static type com.as3dmod.modifiers:Bloat.”)Thanks for your time .
my code:
package
{
import com.as3dmod.ModifierStack;
import com.as3dmod.modifiers.Bloat;
import com.as3dmod.plugins.pv3d.LibraryPv3d;
import flash.events.Event;
import org.papervision3d.materials.utils.MaterialsList;
import org.papervision3d.objects.DisplayObject3D;
import org.papervision3d.materials.WireframeMaterial;
import org.papervision3d.objects.primitives.*;
import org.papervision3d.view.BasicView;
public class AS3Bloat extends BasicView{
private var material:WireframeMaterial;
private var bl:Bloat;
private var m:ModifierStack;
private var step:Number = 0;
private var radius:Number =0;
//private var cube:Cube;
private var cube:Cube;
public function AS3Bloat()
{
material= new WireframeMaterial();
cube = new Cube(new MaterialsList( { all: material } ), 400, 400, 400,8,8,8);
scene.addChild(cube);
m = new ModifierStack(new LibraryPv3d(), cube);
bl = new Bloat();
m.addModifier(bl);
m.apply();
startRendering();
}
protected override function onRenderTick(e:Event=null):void
{
cube.yaw(1);
bl.radius = 1500 * Math.sin(step*0.1);
m.apply();
super.onRenderTick(e);
step ++;
}
}
}
@ge5
I looked at your error and it is not finding the property “radius”. I think the property name you are looking for is “r”.
So instead of
bl.radius = 1500 * Math.sin(step*0.1);
Should be
bl.r = 1500 * Math.sin(step*0.1);