// ==== Standard POV-Ray Includes ==== #include "colors.inc" // Standard Color definitions #include "textures.inc" // Standard Texture definitions #include "functions.inc" // internal functions usable in user defined functions #include "metals.inc" global_settings{ assumed_gamma 1 ambient_light rgb<1, 1, 1> } background {<1,1,1>} #declare lclock=clock+ .0; //local clock varaiable #declare pendulum_angle=lclock*360; //where in the orbit the pendulum is now #declare stringlength = 50; #declare dangle = 20; //angle from vertical of pendulum string #declare pendulum_radius=stringlength*sin(radians(dangle)); //radius of pendulum "orbit" #declare cone_height=stringlength*cos(radians(dangle)); //height of cone #declare x_ball= pendulum_radius*cos(radians(pendulum_angle)); #declare z_ball= pendulum_radius*sin(radians(pendulum_angle)); #declare ball_pos=x_ball*x+z_ball*z; #declare ball_radius=.05*stringlength; sphere{0, ball_radius translate ball_pos texture{T_Brass_3B } } cylinder{cone_height*y,ball_pos,.125*ball_radius texture {T_Gold_1B } } //geometry union{ torus { pendulum_radius, .05*ball_radius } cylinder{ -ball_radius*y,cone_height*y,.05*ball_radius } cylinder{ ball_pos,0*y,.05*ball_radius } pigment{ color rgbt <.1,.1,.1,.6> } finish {ambient 1 } no_shadow no_reflection } //vectors #declare vec_length = .4*stringlength; #declare head_length = .05*stringlength; #declare vec_radius = .15*ball_radius; #declare head_radius =3*vec_radius; #declare vdir=cone_height*y-ball_pos; #declare vdir=vdir/vlength(vdir); //unit vector from ball to fixed end of string union{ cylinder{0,(vec_length-head_length)*vdir,vec_radius} cone{(vec_length-head_length)*vdir,head_radius,vec_length*vdir,0} text { ttf "Times" "T" .005, 0 scale 6 translate 1.1*vec_length*vdir } translate ball_pos pigment{ color rgb <1,0,0> } finish { ambient 1 } no_shadow no_reflection } #declare vec_hlength=vec_length*sin(radians(dangle)); #declare vhdir=-ball_pos/vlength(ball_pos); //unit vector from ball to center of orbit union{ cylinder{0,(vec_hlength-head_length)*vhdir,vec_radius} cone{(vec_hlength-head_length)*vhdir,head_radius,vec_hlength*vhdir,0} union{ text { ttf "Times" "F" .005, 0 scale 6 translate 1.2*y-2.2*x } text { ttf "Times" "c" .005, 0 scale 4 translate .6*y-.6*x } translate 1.1*vec_hlength*vhdir } translate ball_pos pigment{ color rgb <0,0,1> } finish { ambient 1 } no_shadow no_reflection } #declare vec_vlength=vec_length*cos(radians(dangle)); #declare vvdir=-y; //unit vector from ball to center of orbit union{ cylinder{0,(vec_vlength-head_length)*vvdir,vec_radius} cone{(vec_vlength-head_length)*vvdir,head_radius,vec_vlength*vvdir,0} text { ttf "Times" "w" .005, 0 scale 6 translate 1.16*vec_vlength*vvdir-1.7*x } translate ball_pos pigment{ color rgb <0,.5,0> } finish { ambient 1 } no_shadow no_reflection } camera { location 3*<0, stringlength*3 ,-6*stringlength> look_at <0, cone_height*.3, 0> angle 5.5 } //ambient illumination is too dark light_source { <0,+80,-40> color White}