[Papervision3D] filters to objects

NuttyMonk nuttymonk at gmail.com
Mon Aug 25 13:03:31 PDT 2008


I've created a large number of spheres and want to apply a different level of
blur filter to them depending on their distance from the camera. 
'particles' is an array...

var partMat:ColorMaterial = new ColorMaterial(0xFF0000, 1);
for (var i:uint=0; i<100; i++)
{
var newParticle:Sphere = new Sphere(partMat, 10, 8, 8);
newParticle.name = "child" + i;
scene.addChild(newParticle);
newParticle.x = Math.random() * 2000 - 1000;
newParticle.y = Math.random() * 2000 - 1000;
newParticle.z = Math.random() * 2000 - 1000;
particles.push(newParticle);
}

then later on in the Enter.Frame rendering function i have this...

for (var i:uint = 0; i < particles.length ; i++)
{
var thisChild:DisplayObject3D = scene.getChildByName("child" + i);
var thisDist:Number = int(camera.distanceTo(thisChild) * 0.01);
trace (thisDist);
thisChild.filters = [new BlurFilter(thisDist, thisDist, 2)];
}

I can see the calculations for the distances coming out ok but i can't get
the filters applied to the spheres.  Can anyone help me with this?

I'm using revision 709 of the CS4 branch.

Cheers

NM
-- 
View this message in context: http://www.nabble.com/filters-to-objects-tp19150637p19150637.html
Sent from the Papervision3D mailing list archive at Nabble.com.




More information about the Papervision3D mailing list