Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "colors.inc"
- #declare step = 0.01;
- #declare xfactor = 1;
- #declare interval_start = 0;
- #declare interval_end = 1.4;
- #declare obj_end = 13;
- #declare diff = interval_end-interval_start;
- #declare k_interval = diff-1.4;
- #declare f = function(x) {(2.2*pow(x, 2)-2.66*x+5.1)*xfactor}
- #declare g = function(x) {(-3.5714*x+6.3)*xfactor}
- #declare h = function(x) {(3.7*pow(x,-0.078))*xfactor}
- #declare i = function(x) {(1.5*x+1.5)*xfactor}
- #declare j = function(x) {4.2*xfactor}
- #declare k = function(x) {(-2*x+9)*xfactor}
- #declare l = function(x) {(3*x-5)*xfactor}
- #declare m = function(x) {(0.12386*pow(x, 2)-1.2641*x+4.52)*xfactor}
- #declare n = function(x) {(1.3+sqrt(pow(0.95,2)-pow((x-6.25),2)))*xfactor}
- #declare o = function(x) {(sqrt(x-7.2)*1.9+1.3)*xfactor}
- #declare p = function(x) {(-4*pow(2, -3/4*(x-8.058))+5.862)*xfactor}
- #macro cylindersInInterval(i_start, i_end, func)
- #for (index, i_start, i_end-step, step)
- cylinder {
- <index, 0, 0>,
- <index+step, 0, 0>,
- func(index)
- texture { pigment{Gold} }
- }
- #end
- #end
- background{Grey}
- light_source {<6.5, -17, 0>, White}
- camera{
- location <6.5, -17, 0>
- look_at<6.5, 10, 0>
- }
- box {
- <0,0,0>
- <1,1,1>
- texture {
- pigment{White}
- }
- }
- #for (index, 0, 0.56-step, step)
- cylinder {
- <index-k_interval, 0, 0>,
- <index+step-k_interval, 0, 0>,
- f(index)
- texture { pigment{Gold} }
- }
- #end
- #for (index, 0.56, 0.7-step, step)
- cylinder {
- <index-k_interval, 0, 0>,
- <index+step-k_interval, 0, 0>,
- g(index)
- texture { pigment{Gold} }
- }
- #end
- #for (index, 0.7, 1.4-step, step)
- cylinder {
- <index-k_interval, 0, 0>,
- <index+step-k_interval, 0, 0>,
- h(index)
- texture { pigment{Gold} }
- }
- #end
- #for (index, 1.4, 1.8-step, step)
- cylinder {
- <index-k_interval, 0, 0>,
- <index+step, 0, 0>,
- i(index)
- texture { pigment{Gold} }
- }
- #end
- cylindersInInterval(1.8,2.4, j)
- #for (index, 2.4, 2.8-step, step)
- difference{
- cylinder {
- <index, 0, 0>,
- <index+step, 0, 0>,
- k(index)
- texture { pigment{Gold} }
- }
- cylinder {
- <index-0.0001*step, 0, 0>,
- <index+1.0001*step, 0, 0>,
- l(index)
- texture { pigment{Gold} }
- }
- }
- #end
- cylindersInInterval(2.4,5.3, m)
- cylindersInInterval(5.3,7.2, n)
- cylindersInInterval(7.2,10.8, o)
- cylindersInInterval(10.8,obj_end, p)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement