Author Topic: creation smoke  (Read 274 times)

Daimon Fox   «   on: March 10, 2012, 04:17:03 PM »
HI, there is a problem with the creation of smoke for example yellowplanet
class does not work in version 2047b only in 2046 tell me what has changed

package objects
{
    import flare.core.*;
    import flare.materials.*;
    import flare.materials.filters.*;
   
    public class SmokeEmiter extends ParticleEmiter3D
    {
        public function SmokeEmiter( texture:Texture3D )
        {
            var material:Shader3D = new ParticleMaterial3D();
            material.filters.push( new TextureFilter( texture ) );
            material.filters.push( new ColorParticleFilter( [ 0xffffff, 0xffffff, 0xffffff], [ 0, 0.2, 0 ] ) );
            material.build();
           
            super( "smoke", material, new SmokeParticle() );
            super.emitParticlesPerFrame = 2;
            super.particlesLife = 20;
        }
    }
}

import flare.core.*;

class SmokeParticle extends Particle3D
{
    private var speed:Number;
    private var spin:Number;
   
    override public function init( emiter:ParticleEmiter3D ):void
    {
        speed = Math.random() * 5;
        spin = 0.1;
       
        this.x = Math.random() * 20 - 10;
        this.y = Math.random() * 20 - 10;
        this.z = Math.random() * 20 - 10;
       
        var scale:Number = emiter.scaleX;
       
        this.sizeX = scale * 2;
     

Daimon Fox   «   Reply #1 on: March 01, 2012, 04:34:42 PM »
=>

this.sizeY = scale * 2;
    }
   
    override public function update(time:Number):void
    {
        this.y += speed;
        this.rotation += spin;
        this.sizeX *= 1.2;
        this.sizeY *= 1.2;
    }
   
    override public function clone():Particle3D
    {
        return new SmokeParticle();
    }   
}

Daimon Fox   «   Reply #2 on: March 01, 2012, 04:36:10 PM »



Daimon Fox   «   Reply #3 on: March 01, 2012, 04:44:25 PM »



               
                  
                     "

"
                     Daimon F.
                  

               
               

Ivan Vodopiviz   «   Reply #4 on: March 01, 2012, 10:28:08 PM »
Hi,

I just tested YellowPlanet with 2047b and worked just fine. What kind of error are you experiencing?

Daimon Fox   «   Reply #5 on: March 02, 2012, 02:56:13 AM »
no errors, I do not see the result
this source http://www.sendspace.com/file/tiok8z

This code is too complicated for me, whether it is possible to simplify to a minimum?

Ivan Vodopiviz   «   Reply #6 on: March 02, 2012, 05:03:25 AM »
When I tried to run your swf, it raised an error that can be solved by adding the following to your code, after creating the Scene3D object:

scene.registerClass( Flare3DLoader1 );

Cheers,

Daimon Fox   «   Reply #7 on: March 02, 2012, 10:48:55 AM »
I tried to add
 private var Flare3DLoader1: Pivot3D;
 scene.registerClass (Flare3DLoader1)

 but it does not work

Duc VM   «   Reply #8 on: March 02, 2012, 12:27:00 PM »
Hi Daimon. Ivan said. you need register class after scene3D created.
try:
.........
scene=new Scene3D(this);
scene.registerClass (Flare3DLoader1);

Daimon Fox   «   Reply #9 on: March 02, 2012, 03:34:48 PM »
        public function cloud()
        {           
            scene = new Scene3D(this);           
            scene.camera = new Camera3D();
            scene.registerClass( Flare3DLoader1 );
            model = scene.addChildFromFile( "model/smok.f3d" );
            smoke = scene.addTextureFromFile( "model/smoke.png" );
            scene.addEventListener( Scene3D.COMPLETE_EVENT, completeEvent );
        }

do not work, that is not so

Ivan Vodopiviz   «   Reply #10 on: March 02, 2012, 03:53:42 PM »
Hi Daimon,

Any chance of sending me the files in CS5 format? I don't have CS5.5 handy so I wasn't able to compile the .fla you sent me. If you can send me a CS5 version I'll check it out.

Cheers!

Daimon Fox   «   Reply #11 on: March 02, 2012, 06:13:09 PM »

Daimon Fox   «   Reply #12 on: March 07, 2012, 05:39:42 PM »
up

Ivan Vodopiviz   «   Reply #13 on: March 08, 2012, 08:19:44 PM »
Sorry for the delay. I added scene.registerClass( Flare3DLoader1 ); at line 37 of cloud.as and got the following result: http://imgur.com/MEuHt

Is this correct? And there's very little code, what do you want to simplify?

Cheers,

Daimon Fox   «   Reply #14 on: March 08, 2012, 09:32:56 PM »
Hi Ivan, glad to see you!
Please add  all of the code, I have a old mistakes does not work.
Thx.