|
|
"Stephen" <mca### [at] hotmailcom> wrote:
> I am trying to make a spark generator and noticed this behaviour in Pov-Ray
> 3.5 and 3.60.
[snip]
Arrg! I forgot the script :-{
#include "colors.inc"
global_settings { assumed_gamma 2.2
max_trace_level 20}
camera {
orthographic
location < 0.0, 0, -25 >
direction <0, 0, 1>
up <0, 1, 0>
right <4/3, 0, 0>
look_at <0.0, 0, 0>
// angle 3.052 // Sphere and cylinders not Visible with
orthographic camera
// angle 3.053 // Sphere Visible cylinders not Visible with
orthographic camera
angle 3.054 // Sphere and cylinders Visible with orthographic
camera
}
light_source {<30, 20, 0> colour White }
sphere {<0,0,0,> 0.02
pigment { color White }
finish {
reflection {1.0}
phong 0.1
ambient 0.5
diffuse 0.7
}
}
sky_sphere {
pigment {
gradient y
color_map {
[0.0 Gray40 ]
[0.5 Gray10 ]
[1.0 Gray40 ]
}
}
}
////// Setting up variables
#declare R1 = seed(123457);
#declare T_Base = 20;
#declare Time_Count = 1;
#declare Particle_pos = array[3] [T_Base+1]
#declare Updown = 0;
#declare Y_Scale = .05;
#declare Particle_pos [0] [0] = 0 ;
#declare Particle_pos [1] [0] = 0 ;
#declare Particle_pos [2] [0] = 0 ;
////// Setting up weighting
#declare Time_Count = 1;
#while (Time_Count <= T_Base)
#switch (Particle_pos [1][(Time_Count - 1)]) //
#range(-10, -0.9)
#declare Updown = 0.1 * Y_Scale ;
#break
#range(-0.8999, -0.8)
#declare Updown = (rand(R1)-.1)*Y_Scale ;
#break
#range(-0.7999, -0.7)
#declare Updown = (rand(R1)-.2)*Y_Scale ;
#break
#range(-0.6999, -0.6)
#declare Updown = (rand(R1)-.3)*Y_Scale ;
#break
#range(-0.5998, -0.5)
#declare Updown = (rand(R1)-.4)*Y_Scale ;
#break
#range(-0.4999, 0.5)
#declare Updown = (rand(R1)-.5)*Y_Scale ;
#break
#range(0.5001, 0.6)
#declare Updown = -(rand(R1)-.6)*Y_Scale ;
#break
#range(0.6001, 0.7)
#declare Updown = -(rand(R1)-.7)*Y_Scale ;
#break
#range(0.7001, 0.8)
#declare Updown = -(rand(R1)-.8)*Y_Scale ;
#break
#range(0.8001, 0.9)
#declare Updown = -(rand(R1)-.9)*Y_Scale ;
#break
#range(0.9001, 10)
#declare Updown = -1 * Y_Scale ;
#break
#else
#declare Updown = Updown ;
#end
////// Working out out cylinder positions
#declare Particle_pos [0] [Time_Count] = (Particle_pos [0] [Time_Count
-1]) + 1/T_Base ;
#if (Time_Count > (0.75*T_Base)&Time_Count < (0.95*T_Base))
#declare Particle_pos [1] [Time_Count] = (Particle_pos
[1][Time_Count-1]+(Updown*1))/1.25 ;
#else
#declare Particle_pos [1] [Time_Count] = (Particle_pos
[1][Time_Count-1]+(Updown*1))/1.75 ;
#end
#if (Time_Count <= (0.75*T_Base))
#declare Particle_pos [1] [Time_Count] = Particle_pos
[1][Time_Count-1]+Updown ;
#end
#declare Particle_pos [2] [Time_Count] = 0 ;
#declare Time_Count = Time_Count +1;
#end
#declare Time_Count = T_Base;
////// Drawing the cylinders
//* // Coment this section out
and sphere is visible
#while (Time_Count > 0)
cylinder{
<Particle_pos [0][Time_Count-1] ,Particle_pos [1][Time_Count-1]
,Particle_pos [2][Time_Count-1] >,
<Particle_pos [0][Time_Count] ,Particle_pos [1][Time_Count]
,Particle_pos [2][Time_Count] > , 0.01
pigment { color White }
}
#declare Time_Count = Time_Count -1;
#end
//*/
Post a reply to this message
|
|