#include "colors.inc" #include "golds.inc" #include "metals.inc" #include "woods.inc" #include "transforms.inc" #include "shapes.inc" #include "math.inc" #include "glass.inc" #include "stones.inc" #include "textures.inc" // isosurfaces are "math graphs in 3D" #declare iso1 = isosurface { function { sqrt(x*x*x - y*y - z) } // try various math "equations" or functions // since isosufaces are like planes (go on forever), //they must be "contained" by another invisible shape contained_by { box {<-1,-1,-1>, <1,1,1>} } pigment {color White} } object { iso1 translate <-1,0,0>} object { iso1 pigment {Red} // this "multiplies" every point in the box by a matrix (i.e. full control over transformations) // this one will "shear" the box matrix < 1, 1, 0, // this is the "x" row so any "new x" becomes 1*"old x" + 1*"old y" + 0* "old z" 0, 1, 0, // this is the "y" row so any "new y" becomes 0*"old x" + 1*"old y" + 0* "old z" 0, 0, 1, // this is the "z" row so any "new z" becomes 0*"old x" + 0*"old y" + 1* "old z" 0, 0, 0 > // bottom row shifts by 0 on x, 0 on y,0 on z /* try one or more of the following // no transformation matrix < 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 > // stretch twice as high (y) and deep(z) matrix < 1, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0 > */ translate <2,0,0> } // the rest of this is from previous assignments light_source { <0,2,-5> color rgb <1,1,1> } light_source { <1,4,0> color rgb <1,1,1> } light_source { <-1,4,2> color rgb <1,1,1> } camera { location <1.0, 3.0, -5.0> look_at <0.0, 0.0, 0.0> } cylinder{<10, 0, 0>, <-10, 0, 0>, 0.1 pigment {color rgbf <1,0,0,.7> } } cylinder{<0, 10, 0>, <0, -10, 0>, 0.1 pigment {color rgbf <0,0,1,.7>} } cylinder{<0, 0,10>, <0, 0, -10>, 0.1 pigment {color rgbf <0,1,0,.7>} } plane{y, -3 pigment{ Silver }}