// Persistence of Vision Ray Tracer Scene Description File // File: ?.pov // Vers: 3.5 // Desc: 2nd part of b_field // Date: 11/30/04 // Auth: cdk // #version 3.5; #include "colors.inc" global_settings { assumed_gamma 1.0 ambient_light color rgb <1,1,1> } background { color rgb <.1, .4, .7> } //some handy recyclable definitions #declare lclock=clock+.20001; #macro make_arrow(draw_vector,arrow_cap_length,arrow_cap_width,arrow_width) #local vector_length=vlength(draw_vector); union{ #if(vector_length<= arrow_cap_length) //cone { <0, 1, 0>, 0.0, <0, -1, 0>, 1.0 } cone{0*x,vector_length/arrow_cap_length*arrow_cap_width,draw_vector,0} #else cone{draw_vector*(vector_length-arrow_cap_length)/vector_length,arrow_cap_width,draw_vector,0} cylinder{0*x,draw_vector*(vector_length-arrow_cap_length)/vector_length,arrow_width} #end } #end /* cylinder{0,.5*x,.032 texture{mrg_red_texture} translate cp} object{ make_arrow(draw_vector,arrow_cap_length,arrow_cap_width,arrow_width) make_arrow(1.0*x,headl,headw,awidth) texture{mrg_red_texture} translate cp } */ #declare mrg_green_texture= texture { pigment { // (---surface color---) color rgb <.0,.7,.0> } finish { // (---surface finish---) ambient 1.0 specular 0.1 // shiny } } #declare mrg_blue_texture= texture { pigment { // (---surface color---) color rgb <.0,0,3> } finish { // (---surface finish---) ambient 1.0 specular 0.04 // shiny } } #declare black_texture= texture { pigment { // (---surface color---) color rgb <1,1,1> } finish { // (---surface finish---) ambient 1.0 specular 0.1 // shiny } } #declare pink_texture= texture { pigment { // (---surface color---) color rgb <1,0,1> } finish { // (---surface finish---) ambient 1.0 specular 0.1 // shiny } } #declare mrg_red_texture= texture { pigment { // (---surface color---) color rgb <.80,0,.0> } finish { // (---surface finish---) ambient 1.0 specular 0.1 // shiny } } #declare ds=.01; //declare length of segment #declare sfinal = lclock; #declare R=5; #declare xpos = function(ss) { sin(2*pi*ss) } //declare x position #declare ypos = function(ss) { cos(2*pi*ss) } //declare y position #declare zpos = function(ss) { 0 } //declare z position #declare b = 0; //vector drawing sizes #declare arrow_cap_length =.2; #declare arrow_cap_width =arrow_cap_length*.5; #declare arrow_width =arrow_cap_width/4; #declare field_point=<0, 0, -3>; //declare field point #declare s =0; #while (s; //declare source point #declare vec_r = field_point - source_point; #declare dl = - ; #declare vdl= dl/vlength(dl); //adding dB #declare dB= -vcross(dl, vec_r)/pow(vlength(vec_r), 3)*200; /*cylinder { 0, dB, .025 translate field_point texture {mrg_blue_texture} no_shadow} */ #declare b = b+ dB; #declare s = s + ds; #end object{ make_arrow(b/15,arrow_cap_length,arrow_cap_width,arrow_width) texture{mrg_blue_texture} translate field_point no_shadow} /*cylinder { 0, vec_r, .02 translate source_point //draws r hat texture{pink_texture} no_shadow} */ object{ make_arrow(vec_r,arrow_cap_length,arrow_cap_width,arrow_width) texture{pink_texture} translate source_point no_shadow} cylinder { <-5, 0, 0>, <5, 0, 0>, .02 texture{black_texture} //x, y, z axis no_shadow} cylinder { <0, -5, 0>, <0, 5, 0>, .02 texture{black_texture} no_shadow} cylinder { <0, 0, 5>, <0, 0, -5>, .02 texture{black_texture} no_shadow} camera { location <5.5,2, -7.0> right x*image_width/image_height look_at <0, 0, 0> angle 60 } /* */ light_source { <2, -3, 2> // light's position (translated below) color rgb <6, 1, 1> // light's color translate <-10, 8, -20>//place it to the left (neg x), above (pos y) and //behind (neg z) vantage point } // ---------------------------------------- //draw entire current segment #declare s=0; #declare field_point=<0, 0, -3>; //declare field point #declare source_point=; //declare source point #while (s<= sfinal) cylinder { , , .1 texture{mrg_green_texture} pigment { // (---surface color---) color rgbt <.0,.5,.0> }} #declare s = s+ds; //modify s with each loop of while loop #declare source_point=; #end