// PoVRay 3.7 Scene File "primitives_test.pov" // author: ... // date: ... //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- #version 3.7; #include "colors.inc" #version 3.8; global_settings{ assumed_gamma 1.0 } //-------------------------------------------------------------------------- // camera ------------------------------------------------------------------ #declare Camera_0 = camera {/*ultra_wide_angle*/ angle 75 // front view location <0.0 , 1.0 ,-3.0> right x*image_width/image_height look_at <0.0 , 1.0 , 0.0>} #declare Camera_1 = camera {/*ultra_wide_angle*/ angle 90 // diagonal view location <2.0 , 2.5 ,-3.0> right x*image_width/image_height look_at <0.0 , 1.0 , 0.0>} #declare Camera_2 = camera {/*ultra_wide_angle*/ angle 90 // right side view location <3.0 , 1.0 , 0.0> right x*image_width/image_height look_at <0.0 , 1.0 , 0.0>} #declare Camera_3 = camera {/*ultra_wide_angle*/ angle 90 // top view location <0.0 , 3.0 ,-0.001> right x*image_width/image_height look_at <0.0 , 1.0 , 0.0>} camera{Camera_0} // sun --------------------------------------------------------------------- light_source{<-1500,2500,-2500> color White} // sky --------------------------------------------------------------------- sky_sphere { pigment { gradient <0,1,0> color_map { [0.00 rgb <1.0,1.0,1.0>] [0.30 rgb <0.0,0.1,1.0>] [0.70 rgb <0.0,0.1,1.0>] [1.00 rgb <1.0,1.0,1.0>] } scale 2 } // end of pigment } //end of skysphere // fog --------------------------------------------------------------------- fog{fog_type 2 distance 50 color White fog_offset 0.1 fog_alt 2.0 turbulence 2 lambda 3 omega 0.75} // ground ------------------------------------------------------------------ plane{ <0,1,0>, 0 texture{ pigment{ color rgb <0.825,0.57,0.35>} normal { bumps 0.75 scale 0.025 } finish { phong 0.1 } } // end of texture } // end of plane //-------------------------------------------------------------------------- //---------------------------- objects in scene ---------------------------- #include "primitives.inc" #warning str(<0.1, 0.2, 4>.red, 0, -1) #warning str(<0.1, 0.2, 4>.z, 0, -1) #warning str(<0.1, 0.2, 4>.u, 0, -1) // swap() #warning "----------- testing swap()" #declare a = 0; #declare b = 1; #warning concat("(a, b) = (", str(a, 0, 0), ", ", str(b, 0, 0), ")") swap(a, b) #warning concat("(a, b) = (", str(a, 0, 0), ", ", str(b, 0, 0), ")") // exec() #warning "----------- testing exec()" exec ("#debug \"exec'ing\"\n") exec(" sphere { 0, 1 pigment{Blue} }" ) // The following is to be avoided exec("#declare s = sphere{0, 1 pigment {Yellow} translate y}") object {s} // tovector() #warning "----------- testing tovector()" #warning "====================" #declare junk = tovector(1); #warning concat("tovector(1) : ", tostring(junk, TYPES._vector_)) #warning "====================" #declare junk = tovector(<-1, 1>); #warning concat("tovector(<-1, 1>) : ", tostring(junk, TYPES._vector_)) #warning "====================" #declare junk = tovector(<-1, 1, 2>); #warning concat("tovector(<-1, 1, 2>) : ", tostring(junk, TYPES._vector_)) #warning "====================" #declare junk = tovector(<-1, 1, 2, 3>); // suspicious conversion warning #warning concat("tovector(<-1, 1, 2, 3>) : ", tostring(junk, TYPES._vector_)) #warning "====================" #declare junk = tovector(color <0.1, 0.2, 0.4>); // suspicious conversion warning #warning concat("tovector(color <0.1, 0.2, 0.4>) : ", tostring(junk, TYPES._vector_)) #warning "====================" #declare junk = tovector(Yellow); // suspicious conversion warning #warning concat(tostring(junk, TYPES._vector_)) // sequence(), next() #warning "----------- testing sequence(), next()" #declare seq = sequence(0, 2) #for (i, 0, 10) #warning tostring(next(seq), TYPES._int_) #end // interval() #warning "----------- testing interval()" #declare itv = interval(5, 15); #warning str(itv[0], 0, 0) #warning str(itv[1], 0, 0) #warning str(in(2, itv), 0, 0) #warning str(in(12, itv), 0, 0) // check() // Note : unless otherwise stated, commented lines generate a parser error. #warning "----------- testing check() : bool" //#warning str(check(0.5, TYPES._bool_), 0, 0) // error in check() macro. #warning str(check(0, TYPES._bool_), 0, 0) #warning str(check(1.00, TYPES._bool_), 0, 0) //#warning str(check(2, TYPES._bool_), 0, 0) // error in check() macro. //#warning str(check("blabla", TYPES._bool_), 0, 0) //#warning str(check(pigment{Yellow}, TYPES._bool_), 0, 0) #warning "----------- testing check() : int" //#warning str(check(0.5, TYPES._int_), 0, 0) #warning str(check(0, TYPES._int_), 0, 0) #warning str(check(1, TYPES._int_), 0, 0) //#warning str(check("blabla", TYPES._int_), 0, 0) //#warning str(check(pigment{Yellow}, TYPES._int_), 0, 0) #warning "----------- testing check() : float" #warning str(check(0.5, TYPES._float_), 0, 0) #warning str(check(0, TYPES._float_), 0, 0) #warning str(check(1, TYPES._float_), 0, 0) //#warning str(check(<1, 1>, TYPES._float_), 0, 0) //#warning str(check("blabla", TYPES._float_), 0, 0) //#warning str(check(pigment{Yellow}, TYPES._float_), 0, 0) #warning "----------- testing check() : vector" #warning vstr(3, check(0.5, TYPES._vector_), ", ", 0, -1) #warning vstr(3, check(0, TYPES._vector_), ", ", 0, -1) #warning vstr(3, check(1, TYPES._vector_), ", ", 0, -1) #warning vstr(3, check(<1, 2>, TYPES._vector_), ", ", 0, -1) #warning vstr(3, check(<1, 2, 3>, TYPES._vector_), ", ", 0, -1) #warning vstr(3, check(<1, 2, 3, 4>, TYPES._vector_), ", ", 0, -1) //#warning vstr(3, check("blabla", TYPES._vector_), ", ", 0, -1) //#warning vstr(3, check(pigment{Yellow}, TYPES._vector_), ", ", 0, -1) #warning "----------- testing check() : uv" #warning vstr(2, check(0.5, TYPES._uv_), ", ", 0, -1) #warning vstr(2, check(0, TYPES._uv_), ", ", 0, -1) #warning vstr(2, check(1, TYPES._uv_), ", ", 0, -1) #warning vstr(2, check(<1, 2>, TYPES._uv_), ", ", 0, -1) #warning vstr(2, check(<1, 2, 3>, TYPES._uv_), ", ", 0, -1) #warning vstr(2, check(<1, 2, 3, 4>, TYPES._uv_), ", ", 0, -1) //#warning vstr(2, check("blabla", TYPES._uv_), ", ", 0, -1) //#warning vstr(2, check(pigment{Yellow}, TYPES._uv_), ", ", 0, -1) #warning "----------- testing check() : color" #warning vstr(5, check(0.5, TYPES._color_), ", ", 0, -1) #warning vstr(5, check(0, TYPES._color_), ", ", 0, -1) #warning vstr(5, check(1, TYPES._color_), ", ", 0, -1) #warning vstr(5, check(<1, 2>, TYPES._color_), ", ", 0, -1) #warning vstr(5, check(<1, 2, 3>, TYPES._color_), ", ", 0, -1) #warning vstr(5, check(<1, 2, 3, 4>, TYPES._color_), ", ", 0, -1) #warning vstr(5, check(<1, 2, 3, 4, 5>, TYPES._color_), ", ", 0, -1) #warning vstr(5, check(Scarlet, TYPES._color_), ", ", 0, -1) #warning vstr(5, check(color red 0.9 green 0.5 blue 0.2, TYPES._color_), ", ", 0, -1) #warning vstr(5, check(rgb <0.9, 0.5, 0.2>, TYPES._color_), ", ", 0, -1) #warning vstr(5, check(rgbf <0.9, 0.5, 0.2, 0.5>, TYPES._color_), ", ", 0, -1) #warning vstr(5, check(rgbft <0.9, 0.5, 0.2, 0.5, 0.5>, TYPES._color_), ", ", 0, -1) //#warning vstr(2, check("blabla", TYPES._uv_), ", ", 0, -1) //#warning vstr(2, check(pigment{Yellow}, TYPES._uv_), ", ", 0, -1) #warning "----------- testing check() : string" #warning check("blabla", TYPES._string_) //#warning check(1, TYPES._string_) //#warning check(pigment{Yellow}, TYPES._string_) #warning "----------- testing check() : object" #declare junk = check(sphere {0, 1}, TYPES._object_); #warning "sphere {0, 1} OK" //#declare junk = check(1, TYPES._object_); //#decalre junk = check(pigment{Yellow}, TYPES._object_) #warning "----------- testing check() : material" //#declare junk = check(pigment {Red}, TYPES._material_); //#declare junk = check(texture {pigment {Red}}, TYPES._material_); //#declare junk = check(material {pigment {Red}}, TYPES._material_); #declare junk = check(material {texture {pigment {Red}}}, TYPES._material_); #warning "material {texture {pigment {Red}}} OK" //#declare junk = check(1, TYPES._material_); //#declare junk = check("blabla", TYPES._material_); #warning "----------- testing check() : texture" #declare junk = check(texture {pigment {Red}}, TYPES._texture_); #warning "texture {pigment {Red}} OK" #declare junk = check(pigment {Red}, TYPES._texture_); #warning "pigment {Red} OK" //#declare junk = check(material {texture {pigment {Red}}}, TYPES._texture_); //#declare junk = check(1, TYPES._texture_); //#declare junk = check("blabla", TYPES._texture_); // Now, I think we can assume that the Sdl parser generates an error when assigning // a value of wrong standard Sdl type (pigment, normal, finish, spline, color_map, rainbow, ...). // Therefore, the control made by check() can be declared valid for the purpose. // // The are some other non-standard types that require specific testing: dictionary and instance, // which are specific of PROOF. // #warning "----------- testing check() : dictionary" #declare junk = check(dictionary {}, TYPES._dictionary_); #warning "dictionary {} OK" #declare dd = dictionary {} #declare dd["____xj6T&m%ZZq$$*@=qn____"] = 0; #declare junk = check(dd, TYPES._dictionary_); #warning "dd[\"____xj6T&m%ZZq$$*@=qn____\"] OK" #warning "----------- testing check() : instance" #declare junk = check(dictionary {.classname : "Junk"}, TYPES._instance_); #warning concat("instance of ", junk.classname, " OK") //#declare junk = check(dictionary {}, TYPES._instance_); // tostring() #warning "----------- testing tostring() : bool" #warning concat("0 : ", tostring(0, TYPES._bool_)) #warning concat("1 : ", tostring(1, TYPES._bool_)) #warning concat("1.0 : ", tostring(1.0, TYPES._bool_)) #warning concat("yes: ", tostring(yes, TYPES._bool_)) //#warning tostring(0.5, TYPES._bool_) // catched error in tostring() macro //#warning tostring("blabla", TYPES._bool_) // error in tostring() macro //#warning tostring(pigment{White}, TYPES._bool_) // error in tostring() macro #warning "----------- testing tostring() : int" #warning concat("0 : ", tostring(0, TYPES._int_)) #warning concat("1 : ", tostring(1, TYPES._int_)) #warning concat("1.0 : ", tostring(1.0, TYPES._int_)) #warning concat("yes: ", tostring(yes, TYPES._int_)) //#warning tostring(0.5, TYPES._int_) // catched error in tostring() macro //#warning tostring("blabla", TYPES._int_) // error in tostring() macro //#warning tostring(pigment{White}, TYPES._int_) // error in tostring() macro #warning "----------- testing tostring() : float" #warning concat("0 : ", tostring(0, TYPES._float_)) #warning concat("1 : ", tostring(1, TYPES._float_)) #warning concat("1.0 : ", tostring(1.0, TYPES._float_)) #warning concat("yes: ", tostring(yes, TYPES._float_)) #warning concat("0.5 : ", tostring(0.5, TYPES._float_)) //#warning tostring("blabla", TYPES._float_) // error in tostring() macro //#warning tostring(pigment{White}, TYPES._float_) // error in tostring() macro #warning "----------- testing tostring() : vector" #warning concat("0 : ", tostring(0, TYPES._vector_)) #warning concat("1 : ", tostring(1, TYPES._vector_)) #warning concat("1.0 : ", tostring(1.0, TYPES._vector_)) #warning concat("yes: ", tostring(yes, TYPES._vector_)) #warning concat("0.5 : ", tostring(0.5, TYPES._vector_)) #warning concat("<0.5, 0.6> : ", tostring(<0.5, 0.6>, TYPES._vector_)) #warning concat("<0.5, 0.6, 0.7> : ", tostring(<0.5, 0.6, 0.7>, TYPES._vector_)) #warning concat("<0.5, 0.6, 0.7, 0.8> : ", tostring(<0.5, 0.6, 0.7, 0.8>, TYPES._vector_)) // suspicious conversion #warning concat("<0.5, 0.6, 0.7, 0.8, 0.9> : ", tostring(<0.5, 0.6, 0.7, 0.8, 0.9>, TYPES._vector_)) // suspicious conversion //#warning tostring("blabla", TYPES._vector_) // error in tostring() macro //#warning tostring(pigment{White}, TYPES._vector_) // error in tostring() macro #warning "----------- testing tostring() : uv" #warning concat("0 : ", tostring(0, TYPES._uv_)) #warning concat("1 : ", tostring(1, TYPES._uv_)) #warning concat("1.0 : ", tostring(1.0, TYPES._uv_)) #warning concat("yes: ", tostring(yes, TYPES._uv_)) #warning concat("0.5 : ", tostring(0.5, TYPES._uv_)) #warning concat("<0.5, 0.6> : ", tostring(<0.5, 0.6>, TYPES._uv_)) #warning concat("<0.5, 0.6, 0.7> : ", tostring(<0.5, 0.6, 0.7>, TYPES._uv_)) #warning concat("<0.5, 0.6, 0.7, 0.8> : ", tostring(<0.5, 0.6, 0.7, 0.8>, TYPES._uv_)) // suspicious conversion #warning concat("<0.5, 0.6, 0.7, 0.8, 0.9> : ", tostring(<0.5, 0.6, 0.7, 0.8, 0.9>, TYPES._uv_)) // suspicious conversion //#warning tostring("blabla", TYPES._uv_) // error in tostring() macro //#warning tostring(pigment{White}, TYPES._uv_) // error in tostring() macro #warning "----------- testing tostring() : color" #warning concat("0 : ", tostring(0, TYPES._color_)) #warning concat("1 : ", tostring(1, TYPES._color_)) #warning concat("1.0 : ", tostring(1.0, TYPES._color_)) #warning concat("yes: ", tostring(yes, TYPES._color_)) #warning concat("0.5 : ", tostring(0.5, TYPES._color_)) #warning concat("<0.5, 0.6> : ", tostring(<0.5, 0.6>, TYPES._color_)) #warning concat("<0.5, 0.6, 0.7> : ", tostring(<0.5, 0.6, 0.7>, TYPES._color_)) #warning concat("<0.5, 0.6, 0.7, 0.8> : ", tostring(<0.5, 0.6, 0.7, 0.8>, TYPES._color_)) // suspicious conversion #warning concat("<0.5, 0.6, 0.7, 0.8, 0.9> : ", tostring(<0.5, 0.6, 0.7, 0.8, 0.9>, TYPES._color_)) // suspicious conversion //#warning tostring("blabla", TYPES._color_) // error in tostring() macro //#warning tostring(pigment{White}, TYPES._color_) // error in tostring() macro #warning "----------- testing tostring() : string" //#warning concat("0 : ", tostring(0, TYPES._string_)) // error in tostring() macro //#warning concat("1 : ", tostring(1, TYPES._string_)) // error in tostring() macro //#warning concat("1.0 : ", tostring(1.0, TYPES._string_)) // error in tostring() macro //#warning concat("yes: ", tostring(yes, TYPES._string_)) // error in tostring() macro //#warning concat("0.5 : ", tostring(0.5, TYPES._string_)) // error in tostring() macro //#warning concat("<0.5, 0.6> : ", tostring(<0.5, 0.6>, TYPES._string_)) // error in tostring() macro //#warning concat("<0.5, 0.6, 0.7> : ", tostring(<0.5, 0.6, 0.7>, TYPES._string_)) // error in tostring() macro //#warning concat("<0.5, 0.6, 0.7, 0.8> : ", tostring(<0.5, 0.6, 0.7, 0.8>, TYPES._string_)) // error in tostring() macro //#warning concat("<0.5, 0.6, 0.7, 0.8, 0.9> : ", tostring(<0.5, 0.6, 0.7, 0.8, 0.9>, TYPES._string_)) // error in tostring() macro #warning tostring("blabla", TYPES._string_) //#warning tostring(pigment{White}, TYPES._string_) // error in tostring() macro //--------------------------------------------------------------------------