8 Replies Latest reply on Dec 31, 2009 9:34 AM by sojourner146

    problem making animated fire

    sojourner146

      I've made room model with  a fireplace and placed a grate and logs in the firebox area.  First I tried making fire with a particle system and got a pretty nice-looking flame ......until I positioned it in the firebox above the logs.  Then it was only rendered in an area clipped by the outline of the logs when seen from the middle of the room.  It still looked good up close from an oblique angle or from behind the fireplace (with the room and fireplace normals directed away from the camera.  I tried re-orienting everything, thinking it was a normals problem, but couldn't get any changes to make the fire look good from a desireable viewing angle.

       

      Next I tried an animated texture on a plane and got a similar result.  The models look good in Max, the mapping and normals are good, but in Director the plane with the animated texture only is visible from weird angles and generally clipped by the shaps of the models behind the plane.  I have a similar animated texture applied the pendulum of a clock in the same room that works fine but so far all my efforts to start a fire in the fireplace look pretty dismal.

       

      Any suggestions for making this effect work other than applying an animated texture to the firebox walls?

        • 1. Re: problem making animated fire
          James Newton, ACP Level 3

          You can find an example of animated fire here: http://nonlinear.openspark.com/tips/3D/flame/http://nonlinear.openspark.com/tips/3D/flame/.  I have created fire using particle emitters in a number of applications without encountering the problems that you mention.

          • 2. Re: problem making animated fire
            sojourner146 Level 1

            Thank you for taking an interest in this!   Please take a look at:  http://www.elfstonestudio.com/ChristmasRoom_giftsAnim03.dcr .  It takes a while to open.  I'm still a newbie at Lingo and still figuring out how to organize things.  Your Flame example was what inspired me to attempt the fireplace in the first place - your flame looks really good to me.  When the .dcr file opens the flames in the fireplace aren't apparent but if you use the up arrow key to move closer they will suddenly appear.  If you back up they will disappear again.  I have the same problem with an animated texture on a plane.  This, however, is better than it was earlier.  Before the logs and grate were separate models but then I attached them to the "room" model in 3DS Max. That made the whole particle system show up  from close by.  I adapted your code to make the fire and also snow which you can see out of the window on the opposite side of the room.  I think the snow is working well.  I would very much appreciate any ideas you may have as to what is happening.  This is like learning Chinese for me.

             

            I also really like your example of painting on a 3D model.  I have so far understood it well enough to replace the cone with an Easter egg.  I would like to combine it with the Paint Box capabilities  so that I could make it possible for viewers to decorate their own eggs, etc.  I haven't yet had a chance to experiment with getting things other than buttons to communicate with the 3D sprite.  Can you suggest any articles that might help.  Since I have no background in this, small tips make an amazing amount of difference:  I spent months figuring out how to make billboard trees from an image map until an experienced coder pointed out that I needed to put "trees+1" rather than "trees".  It was a revelation.

             

            Sue Meyer

             

             

            on createFlame(me)

             

             

            -- flame1Tex = gWorld.newTexture("flame1Tex", #fromCastMember, member("flame"))

             

             

            -- flame1Res = gWorld.newModelResource("flame1", #particle)

             

             

            -- flame1Res.texture = flame1Tex

             

            flame1 = gWorld.

             

            newModelResource("Flame 1", #particle)

            flame1Model = GWorld.

            newModel("Flame 1", flame1)

            flame1.

            emitter.maxSpeed = 100

            flame1.

             

            emitter.numParticles = 500

            flame1.

             

            emitter.angle = 2

            flame1.

             

            emitter.direction = vector( 0, 0, 1 )

            flame1.

            lifeTime = 2000

            flame1.

             

            colorRange.start = rgb(255, 255, 128)

            flame1.

            colorRange.end = rgb(192, 96, 0)

            flame1.

            sizeRange.start = 3

            flame1.

             

            blendRange.end = 0

             

             

             

            -- flame1Model = gWorld.newModel("flame1", flame1Res)

             

             

            -- flame1Model.translate(-110, -40, 0) -- need to check if this is necessary in combo with emmitter region

             

             

             

            -- flame2Tex = gWorld.newTexture("flame2Tex", #fromCastMember, member("flame2"))

             

             

            -- flame2Res = gWorld.newModelResource("flame2", #particle)

             

             

            -- flame2Res.texture = flame2Tex

             

            flame2 = gWorld.

             

            newModelResource("Flame 2", #particle)

            flame2Model = gWorld.

            newModel("Flame 2", flame2)

            flame2.

            emitter.maxSpeed = 200

            flame2.

             

            emitter.numParticles = 200

            flame2.

             

            emitter.angle = 2

            flame2.

             

            emitter.direction = vector(0, 0, 1 )

            flame2.

            lifeTime = 1200

            flame2.

             

            colorRange.start = rgb(255, 255, 0)

            flame2.

            colorRange.end = rgb(192, 128, 0)

            flame2.

            sizeRange.start = 5

            flame2.

             

            blendRange.end = 0

             

            flame1.

            emitter.region = [vector(263,-410,115), vector(337,-333,115)]

            flame2.

            emitter.region = [vector(263,-405,112), vector(337,-328,112)]

            flame1Model.

            addChild(flame2Model)

             

             

            -- flame2Model = gWorld.newModel("flame2", flame2Res)

             

            -- flame2Model.translate(-110, -40, 0) -- need to check if this is necessary in combo with emmitter region

             

            return

             

            flame1Model

             

            on

             

            createSnow(me)

             

            snowflake1 = gWorld.

            newTexture("snowflake1", #fromCastMember, member("snowflake1-32"))

            snowflake1Res = gWorld.

            newModelResource("flake1-32", #particle)

            snowflake1Res.

            texture = snowflake1

             

            -- small snowflake1-32

            snowflake1Res.

            emitter.minSpeed = 35

            snowflake1Res.

            emitter.maxSpeed = 55

            snowflake1Res.

            emitter.numParticles = 50

             

            snowflake1Res.

            emitter.angle = 90

            snowflake1Res.

            emitter.direction = vector(0, 0, -1 )

            snowflake1Res.

            emitter.region = [vector(-600, 1500, 550), vector(500,1500,700)]

            snowflake1Res.

            emitter.gravity = vector(0, 0, -1 )

            snowflake1Res.

            wind = vector(100.000, 0.000, 0.000 )

            snowflake1Res.

            lifeTime = 30000

            snowflake1Res.

            colorRange.start = rgb(255, 255, 255)

            snowflake1Res.

            colorRange.end = rgb(255, 255, 255)

            snowflake1Res.

            blendRange.start = 100

            snowflake1Res.

            blendRange.end = 0

            snowflake1Res.

            sizeRange.start = 32

            snowflake1Res.

            sizeRange.end = 32

             

            snowflake1Model = gWorld.

            newModel("flake1-32", snowflake1Res)

            snowflake1Model.

            translate(-110, -40, 0)

             

             

            -- small snowflake2-32

            snowflake2 = gWorld.

            newTexture("snowflake2", #fromCastMember, member("snowflake2-32"))

            snowflake2Res = gWorld.

            newModelResource("flake2-32", #particle)

            snowflake2Res.

            texture = snowflake2

             

            snowflake2Res.

            emitter.minSpeed = 35

            snowflake2Res.

            emitter.maxSpeed = 55

            snowflake2Res.

            emitter.numParticles = 50

             

            snowflake2Res.

            emitter.angle = 90

            snowflake2Res.

            emitter.direction = vector(0, 0, -1 )

            snowflake2Res.

            emitter.region = [vector(-600, 1500, 550), vector(500, 1500, 700)]

            snowflake2Res.

            emitter.gravity = vector(0, 0, -1 )

            snowflake2Res.

            wind = vector(100.000, 0.000, 0.000 )

            snowflake2Res.

            lifeTime = 30000

            snowflake2Res.

            colorRange.start = rgb(255, 255, 255)

            snowflake2Res.

            colorRange.end = rgb(255, 255, 255)

            snowflake2Res.

            blendRange.start = 100

            snowflake2Res.

            blendRange.end = 0

            snowflake2Res.

            sizeRange.start = 32

            snowflake2Res.

            sizeRange.end = 32

             

            snowflake2Model = gWorld.

            newModel("flake2-32", snowflake2Res)

            snowflake2Model.

            translate(-110, -40, 0)

             

            end

             

            createSnow(me)

            • 5. Re: problem making animated fire
              sojourner146 Level 1

              I tried a couple of other experiments using the flame from your example, one in the center of the room ( http://www.elfstonestudio.com/ChristmasRoom_candleTest_inside.htm) and one positioned outside the room to the right of the fireplace ( http://www.elfstonestudio.com/ChristmasRoom_candleTest_outside.htm).  Outside the room the flame burns steadily from all directions and at all distances; inside the room it is invisible from some angles until the camera is very close just like the fireplace flame.  I made the room as a box with its normals turned inward and I imagine that this is somehow the source of the problem.  I've tried rotating the fire but that doesn't help - it becomes totally invisible at all distances.  I suppose I will have to build the room differently.  My video card is an Nvidia Quadro FX 1700 so it should be capable of rendering the particle systems.  It is frustrating to see that all examples of the flames show up well from outside the room.  I think this must be some sort of bug?

              • 6. Re: problem making animated fire
                James Newton, ACP Level 3

                The particles used in the fire use a semi-transparent texture.  Is there another semi-transparent texture in your scene?  Director has difficulties determining which of two semi-transparent textures to render first, if there is any overlap between them (z-buffer issue).  Could this be the source of your problem?

                • 7. Re: problem making animated fire
                  sojourner146 Level 1

                  I hadn't used any other shaders with transparency in Director  but I did use a material with an opacity of 0 in Max for the window.  When I made it opaque the problem with the particle systems went away.  I've been planning to use a .png on the window anyhow to create grillwork.  Thank you for helping with this and for giving me some more insight as to how Director works.

                   

                  Sue

                  • 8. Re: problem making animated fire
                    sojourner146 Level 1

                    Just a final note:  while transparent materials applied in 3DS Max cause problems with particle system rendering, transparent textures created and applied in Director don't.  I deleted the window polygon in Max and replaced it with a textured plane in director to simulate a multi-pane window and the fire is still burning brightly.