#include "colors.inc" #declare Speed = 8 // # of times to go through calmness-anger cycle throughout anim. (used to be 16) #declare PRate = clock // rate at which periodicity increases (used to be clock*clock) #declare Osc_x = PRate*(2*pi)*Speed // the idependent (x) value for Sub_Osc, Main_Osc & Main_Osc_Prime #declare Sub_Osc = 0.02*(sin(Osc_x*20)) /* small fluctuations in the final state, so it's not purely harmonic as dictated by Main_Osc */ #declare Main_Osc = 1-(0.5*cos(Osc_x)+0.5) /* main harmonic oscillator for emotion state; 0 is total calmness, 1 is total anger */ #declare Main_Osc_Prime = 0.5*sin(Osc_x) // used to tell if emotion is getting calmer or angrier #declare Ey = Main_Osc #warning concat("Projected Ey value is:",str(Ey,5,3),"\n") // DO NOT LET EY < 0 or BAAAAAD THINGS WILL HAPPEN!! (only Sub_Osc can make this happen) #if (Ey < 0) #declare Ey = 0 #end #warning concat("Actual Ey value is:",str(Ey,5,3),"\n") #warning concat("Main_Osc_Prime value is:",str(Main_Osc_Prime,5,3),"\n"); /* Ex, Parab, and Parab_anti_der are all used for camera motion. Parab_anti_der is the anti-derivative of the camera's motion; hence the camera will start at 0, speed up, then slow down back to 0 by the end of the animation. It is also used as an inflator/deflator for the lighning sphere. */ #declare Ex = (clock*2)-1 #declare Parab = -(Ex*Ex)+1 #declare Parab_anti_der = -(1/3)*(Ex*Ex*Ex)+Ex #declare Pos=Parab_anti_der + (2/3) camera { location look_at <0.0 , 0.0 , 0.0> } light_source { <3, 3, -5> color White } #declare Angry_y = Ey*Ey #declare Angry_Grow_y_Rate = clock/0.6 // used to be (clock+0.25) #if (Angry_Grow_y_Rate > 1.0) #declare Angry_Grow_y_Rate = 1.0 #end #declare Angry_Grow_y = Angry_Grow_y_Rate*Angry_y #warning concat("Angry_Grow_y value is:",str(Angry_Grow_y,5,3),"\n"); #declare Angry_red = rgb <0.7 + (Angry_y*0.3), 0.1, 0> // This normal statement is EXPERIMENTAL #declare Embers = normal { wrinkles 0.25 turbulence 0.05 scale 0.05 phase clock*30 } #declare Anger01_0 = texture { pigment { color Black } normal { Embers } finish { crand 0.2 /* reflection 0.75 specular 0.25 roughness 0.005 */ } // ambient used to be *0.1 } #declare Anger01_1 = texture { pigment { color Angry_red*0.1 } normal { Embers } finish { crand 0.25 } } #declare Anger01_2 = texture { pigment { color Angry_red*0.5 } normal { Embers } finish { crand 0.4 ambient Angry_red*0.5 } } #declare Anger01_3 = texture { pigment { color Angry_red*1.5 } normal { Embers } finish { crand 0.5 ambient Angry_red*1.5 } } #declare Anger = texture { wrinkles texture_map { [0.0 Anger01_0] [0.3 Anger01_0] [0.85 Anger01_1] // used to be 0.85, then 0.5, before 0.85 [0.95 Anger01_2] [1.0 Anger01_3] } turbulence 0.6 lambda 2.75 omega 0.65 phase 0.75-(Angry_y*0.25) // used to be constant 0.675 } #declare Anger_Temp = texture { pigment { color Angry_red } } // Eventually the calmness will turn into anger as well! // BWAHAHAHAHAHAHAHAHAHA!!! #declare Calm_y = (clock*clock)/0.9 // used to be (clock*clock)/0.8, before clock #if (Calm_y > 1.0) #declare Calm_y = 1.0 #end #declare Bright_Boost = (Parab*0.8)+1.0 // parab used to be *0.8 #declare Calm_Blue = color rgb <(Calm_y*1)*Bright_Boost, (1-Calm_y)*0.8*Bright_Boost, (1-Calm_y)*Bright_Boost> #warning concat("Calm_Blue value is:",str(Calm_Blue.red,5,3),",",str(Calm_Blue.green,5,3),",",str(Calm_Blue.blue,5,3),"\n") #declare Calm_Finish = finish { ambient Calm_Blue brilliance 3 } #declare Calm_Normal = normal { waves 0.5 frequency 30 turbulence 0.025 phase clock*30 } #declare Calm = texture { pigment { bozo triangle_wave color_map { [0.0 Calm_Blue*0.75] [1.0 Calm_Blue] } turbulence 0.5 lambda 0.5 phase clock } normal { Calm_Normal } finish { Calm_Finish } } #declare Calm_Temp = texture { pigment { color Calm_Blue } } #declare Emotion_State = texture { bozo texture_map { [0.0 Anger] [Angry_Grow_y Anger] [1.0 Calm] } turbulence 0.75+(Parab*0.1) // used to be 0.75, before 0.5 lambda 1.5+(Parab) // used to be 1.5, before 2 } #declare SL_Rate = clock/0.65 #if (SL_Rate > 1.0) #declare SL_Rate = 1.0 #end #declare Base_Ey = Ey + ((clock*clock)/0.9) // try with CUBIC growth instead of QUADRATIC? second part used to be clock*clock #if (Base_Ey > 1.0) #declare Base_Ey = 1.0 #end #declare S_Ey = Base_Ey*SL_Rate #declare Sphere_Lightning01_0 = texture { pigment { color rgbt <0, 0, 0, 1.0> } finish { ambient 0 } } #declare Sphere_Lightning01_1 = texture { pigment { color rgbt } } #declare Sphere_Lightning01_2 = texture { pigment { color rgbt } // g used to be 0.8, t used to be 1-Ey finish { ambient brilliance S_Ey*10 specular S_Ey*0.5 roughness 0.5*Angry_y } } #declare Sphere_Lightning = texture { agate agate_turb 0.75 texture_map { [0.0 Sphere_Lightning01_0] [0.8 Sphere_Lightning01_1] [1.0 Sphere_Lightning01_2] } turbulence 0.15 lambda 2.5 frequency 2 phase 0.1+(clock*0.8) //phase clock } #declare Wave_Sphere = //this is meant to approximate the normal of the emotionsphere sphere { <0, 0, 0>, 1 texture { pigment { color Calm_Blue } finish { Calm_Finish } normal { Calm_Normal } } } #declare Ember_Sphere = sphere { <0, 0, 0>, 1 texture { pigment { color Angry_red } normal { Embers } finish { crand 0.24 } } } #declare Emotion_Sphere = sphere { <0, 0, 0>, 1 texture { Emotion_State } rotate -z*(360*clock) } #declare Environment_Sphere = sphere { <0, 0, 0>, 1.001+(Parab*0.1) // Parab coefficient used to be 0.075 texture { Sphere_Lightning } rotate z*(360*clock) } union { //object { Wave_Sphere } //object { Ember_Sphere } object { Emotion_Sphere } object { Environment_Sphere } }