POV-Ray : Newsgroups : povray.binaries.images : Gas Flame (needs help) : Re: Gas Flame (needs help) - briquet.jpg (1/1) Server Time
11 Aug 2024 17:17:25 EDT (-0400)
  Re: Gas Flame (needs help) - briquet.jpg (1/1)  
From: Kurts
Date: 22 Mar 2004 02:21:45
Message: <kurtzlepirate-E4BA4D.08214522032004@news.povray.org>
In article <405d9c7a@news.povray.org>, "Steve Shelby" <ssh### [at] rexnetnet> 
wrote:

> The flame is a bezier patch with scattering media. In flame1 the only light
> is a blue spotlight at its base, and it's almost acceptable. As soon as I
> add a point light to the scene (flame2), it's totally unacceptable. I've
> tried tweeking everything I can think of, and can't keep the outside of the
> bezier patch from showing. Is there a way to fix this, or am I going about
> it all wrong?

//  --------------------------------------------------------------------------
//  --- MACRO : FLAMME -------------------------------------------------------
//  --------------------------------------------------------------------------
#macro flamme(FAltitude, rayon, longueur, drawFlame, drawLight, useAreaLight, 
drawGlow)
  // -- flamme --------------------------------------------------------
  #if (drawFlame)
  #declare theFlame = blob {
    threshold 0.5
    #local f=0;
    #while (f<15)
      sphere {
        #local xPos = sin((0.5*f/14)*2)*0.5;
        #local yPos = 0.3+0.5*f/14;
        #local zPos = cos((0.5*f/14)*2)*0.5;
        #local rSphere = (0.4-0.2*f/15);
        <xPos, yPos, zPos>,
        rSphere
        strength 1
        }
        // #debug concat("\nx = ",str(xPos,6,4)," y = ",str(yPos,6,4)," z = 
",str(zPos,6,4)) 
      #local f=f+1;
    #end
    hollow   
    pigment { rgbt 1 }
    interior {
      media {
        method 3
        emission 0.80//rgb <1,.7,.25> 
        density {
          gradient y
          color_map {
            [0.0 rgb <0.2, 0.3, 0.8>*0.8]
            [0.3 rgb <1.0, 0.7, 0.25>]
            }
          scale 2
          }
        density {
          spherical color_map {
          [0.45 rgb 1]
          [.5 rgb 0]}
        scale 1.5/4
        translate 0.3*y
        }
      }
    }
    rotate rand(longueur)*360*y                                        
    scale <rayon,2.5*rayon,rayon>*2
    translate (FAltitude+1)*y
    no_shadow
    }
  #end
  // -- light -----------------------------------------------------------
  #if (drawLight)
  #declare theLight = light_source {
    <0,FAltitude+1+2*rayon,0>
    rgb <1.00, 0.75, 0.50>
    fade_distance 25 //50 ?
    fade_power 2 //3  
    #if (useAreaLight)
      area_light
      1.5*x,1.5*y,3,3
      adaptive 0
      jitter
      orient
      circular
    #end
    media_attenuation on
    }
  #end
  // -- glow ------------------------------------------------------------
  #if (drawGlow)
  #declare theGlow = box {
    -1,1
    hollow
    no_shadow
    pigment {rgbt 1}
    interior {
      media {
        method 3
        emission 0.035
        density {
        spherical
        color_map {
          [0.00 rgb <0.00, 0.00, 0.00>]
          [1.00 rgb <1.00, 0.80, 0.12>]
          }
        turbulence 0.1
        poly_wave 2
        }
      }
    } 
    translate y/2
    scale <rayon,rayon,rayon>*9
    translate FAltitude*y
    }
  #end
  union {
    object { theFlame }
    object { theLight }
    object { theGlow }
    }
#end


#declare alea = seed(0);
object {
  flamme(0,3,alea,true,true,false,true)
  translate <0, 57, 5>
  }


Post a reply to this message


Attachments:
Download 'briquet.jpg' (4 KB)

Preview of image 'briquet.jpg'
briquet.jpg


 

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.