Flint Particle System Forum - BitmapDataZone for 3d space2016-06-03T00:15:26+01:00http://flintparticles.org/forum/
Lussumo Vanilla & Feed Publisher
BitmapDataZone for 3d spacehttp://flintparticles.org/forum/comments.php?DiscussionID=604&Focus=2056#Comment_20562013-08-12T14:28:34+01:002013-08-12T14:30:35+01:00lunacityhttp://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.
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 spacehttp://flintparticles.org/forum/comments.php?DiscussionID=604&Focus=2057#Comment_20572013-08-13T12:13:57+01:002016-06-03T00:15:26+01:00lunacityhttp://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 spacehttp://flintparticles.org/forum/comments.php?DiscussionID=604&Focus=2058#Comment_20582013-08-14T07:46:12+01:002016-06-03T00:15:26+01:00Richardhttp://flintparticles.org/forum/account.php?u=1
Thanks. I've added the fix to the github repository.
BitmapDataZone for 3d spacehttp://flintparticles.org/forum/comments.php?DiscussionID=604&Focus=2089#Comment_20892013-12-01T05:17:30+00:002016-06-03T00:15:26+01:00lumenbeinghttp://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.]]>