Flint Particle System Forum - BitmapDataZone for 3d space Fri, 03 Jun 2016 01:49:13 +0100 http://flintparticles.org/forum/ Lussumo Vanilla 1.1.10 & Feed Publisher BitmapDataZone for 3d space http://flintparticles.org/forum/comments.php?DiscussionID=604&Focus=2056#Comment_2056 http://flintparticles.org/forum/comments.php?DiscussionID=604&Focus=2056#Comment_2056 Mon, 12 Aug 2013 14:28:34 +0100 lunacity 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 http://flintparticles.org/forum/comments.php?DiscussionID=604&Focus=2057#Comment_2057 Tue, 13 Aug 2013 12:13:57 +0100 lunacity 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 http://flintparticles.org/forum/comments.php?DiscussionID=604&Focus=2058#Comment_2058 Wed, 14 Aug 2013 07:46:12 +0100 Richard BitmapDataZone for 3d space http://flintparticles.org/forum/comments.php?DiscussionID=604&Focus=2089#Comment_2089 http://flintparticles.org/forum/comments.php?DiscussionID=604&Focus=2089#Comment_2089 Sun, 01 Dec 2013 05:17:30 +0000 lumenbeing 1067: Implicit coercion of a value of type Logo to an unrelated type flash.display:MovieClip. ]]>