Flint Particle System Forum - BitmapDataZone for 3d space 2016-06-03T00:15:26+01:00 http://flintparticles.org/forum/ Lussumo Vanilla & Feed Publisher BitmapDataZone for 3d space http://flintparticles.org/forum/comments.php?DiscussionID=604&Focus=2056#Comment_2056 2013-08-12T14:28:34+01:00 2013-08-12T14:30:35+01:00 lunacity http://flintparticles.org/forum/account.php?u=692 Hello, I tried to use the logo example for a 3d space, but didn't get it to work. I followed the example and changed all parameters for 3d. I guess my problem is with the 3D BitmapDataZone. I ... I tried to use the logo example for a 3d space, but didn't get it to work.
I followed the example and changed all parameters for 3d. I guess my problem is with the 3D BitmapDataZone.
I guess I'm using the parameters the wrong way. Can you help me?

Here is my code. Everything works fine with the BoxZone Initializer, so I think the problem is the BitmapDataZone.

import org.flintparticles.common.actions.*;
import org.flintparticles.common.counters.*;
import org.flintparticles.common.easing.Quadratic;
import org.flintparticles.common.events.EmitterEvent;
import org.flintparticles.common.initializers.*;
import org.flintparticles.common.displayObjects.Rect;
import org.flintparticles.threeD.actions.*;
import org.flintparticles.threeD.initializers.*;
import org.flintparticles.threeD.zones.*;
import org.flintparticles.threeD.emitters.Emitter3D;
import org.flintparticles.threeD.renderers.*;
import org.flintparticles.threeD.renderers.controllers.*;

var logoClip : MovieClip = new Logo();
var logo:BitmapData = new BitmapData(260, 250, true, 0x00FFFFFF);
logo.draw(logoClip);

var emitter:Emitter3D = new Emitter3D();
emitter.counter = new Steady( 30 );
emitter.addInitializer( new SharedImage( new Rect( 10, 10 ) ) );
emitter.addInitializer( new Lifetime( 3 ) );
emitter.addInitializer( new Position( new BitmapDataZone( logo, new Vector3D( 0, 0, 0 ), new Vector3D( 260, 0, 0 ), new Vector3D( 0, 250, 0 ) ) ) );
//emitter.addInitializer( new Position( new BoxZone( 280, 280, 280, new Vector3D( 0, 0, 0 ), new Vector3D( 0, 1, 0 ), new Vector3D( 0, 0, 1 ) ) ) );
emitter.addInitializer( new Velocity( new PointZone( new Vector3D( 0, 0, -200 ) ) ) );

emitter.addAction( new Move( ) );
emitter.addAction( new Age( Quadratic.easeOut ) );
emitter.addAction( new Fade( 1, 0 ) );
emitter.addAction( new LinearDrag( 0.5 ) );
emitter.start( );

var renderer:BitmapRenderer = new BitmapRenderer( new Rectangle( 0, 0, stage.stageWidth, stage.stageHeight ) );
renderer.addFilter( new BlurFilter( 2, 2, 1 ) );
renderer.addFilter( new ColorMatrixFilter( [ 1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0.66,0 ] ) );
renderer.addEmitter( emitter );
renderer.x = 0;
renderer.y = 0;
addChild( renderer );

renderer.camera.position = new Vector3D( 0, 0, -400 );
renderer.camera.target = new Vector3D( 0, 0, 0 );
renderer.camera.projectionDistance = 400;
var camera = new FirstPersonCamera( stage, renderer.camera );
camera.start();]]>
BitmapDataZone for 3d space http://flintparticles.org/forum/comments.php?DiscussionID=604&Focus=2057#Comment_2057 2013-08-13T12:13:57+01:00 2016-06-03T00:15:26+01:00 lunacity http://flintparticles.org/forum/account.php?u=692 problem found! The "getLocation" function inside the BitmapDataZone Class was wrong. I'm surprised that no one has noticed that before. I fixed it with this code: public function ... I'm surprised that no one has noticed that before.
I fixed it with this code:

public function getLocation():Vector3D
{
if( _dirty )
{
init();
}

var point:Point = Point( _validPoints.getRandomValue() ).clone();
var d1:Vector3D = _scaledWidth.clone();
d1.scaleBy( point.x );
var d2:Vector3D = _scaledHeight.clone();
d2.scaleBy( point.y );
d1.incrementBy( d2 );
var pos = _corner.clone().add( d1 );
return pos;
}]]>
BitmapDataZone for 3d space http://flintparticles.org/forum/comments.php?DiscussionID=604&Focus=2058#Comment_2058 2013-08-14T07:46:12+01:00 2016-06-03T00:15:26+01:00 Richard http://flintparticles.org/forum/account.php?u=1 Thanks. I've added the fix to the github repository. BitmapDataZone for 3d space http://flintparticles.org/forum/comments.php?DiscussionID=604&Focus=2089#Comment_2089 2013-12-01T05:17:30+00:00 2016-06-03T00:15:26+01:00 lumenbeing http://flintparticles.org/forum/account.php?u=703 I get this when I try to run your code: 1067: Implicit coercion of a value of type Logo to an unrelated type flash.display:MovieClip. 1067: Implicit coercion of a value of type Logo to an unrelated type flash.display:MovieClip.]]>