|
|
// Persistence of Vision Ray Tracer Scene Description File
// File: keepingtexturesofCSGinslice.pov
// Vers: 3.1, MegaPov 0.4
// Desc: retaining textures of previous CSG while making a slice
// Date: 00.21
// Auth: Bob Hughes
// Mail: inv### [at] aolcom?Subject=Pov-Scene
// Note: this is only a test file and so might not be a working method
#version 3.1; // unofficial MegaPov 0.4;
#default {texture {pigment {rgb 1}}}
global_settings {
max_trace_level 10
}
// white pointlight at camera position
#declare LCX = -10;
#declare LCY = 10;
#declare LCZ = -10; // (-6.32 = 4x3 view at <0,0,0> if angle 36)
light_source { <LCX,LCY,LCZ> color rgb <1.5,1.5,1.5>
}
camera {
location <LCX,LCY,LCZ>
angle 22.5 // angle 67 ~= direction 1
look_at <0, 0, 0>
}
/*
If the wrapping union (with sphere) of the CSG object
is removed the slice will seem to work right, otherwise not.
Though at this point I'm not sure any of it's correct.
*/
#declare UnionedSphere=no;
// The CSG Model
#declare CSG= // this might be a complete model for example
#if (UnionedSphere=yes)
union { // problem with more complex(?) CSG
sphere {0,1 pigment {rgbft<0,1,1,.133,.67>} scale <3,2,4>}
#end
intersection {
box {-1,1 pigment {rgb<1,1,0>} scale <1,1,1> rotate <30,45,60>}
union {
difference {
sphere {<1,0,0>,1.5 pigment {rgb<1,0,0>}
}
sphere {<-1,0,0>,1.5 pigment {rgb<0,1,0>}
}
} // difference
cone {-1.5*x,0,1.5*x,1 pigment {rgb<0,0,1>}}
} // union
} // intersection
#if (UnionedSphere=yes)
} // union
#end
// CSG // actual model
// The CSG Slice
// intersecting doesn't work right
#declare SliceType=asc("D"); // [I]ntersection or [D]ifference
#declare SliceThickness=0.025;
#declare CSG_Cross_Section=
#switch (SliceType)
#case (73)
intersection {
object {CSG scale <1,1,SliceThickness>
translate (-1.5+(3*clock))*z // slice movement
// inverse
} // end of object
object {CSG
} // end of object
} // closing of intersection
#break
#case (68)
difference {
object {CSG
} // end of object
object {CSG scale <1,1,SliceThickness>
translate (-1.5+(3*clock))*z // slice movement
inverse
} // end of object
} // closing of difference
#break
#end
CSG_Cross_Section // final object seen
// End
// omniVerse http://users.aol.com/persistenceofv/all.htm
Post a reply to this message
|
|