Skip to content

Instantly share code, notes, and snippets.

@SammyVimes
Last active October 16, 2021 11:38
Show Gist options
  • Save SammyVimes/16c055efef5cfeeeead7283ed0af2576 to your computer and use it in GitHub Desktop.
Save SammyVimes/16c055efef5cfeeeead7283ed0af2576 to your computer and use it in GitHub Desktop.
global_settings{ assumed_gamma 1.0 }
#default{ finish{ ambient 0.1 diffuse 0.9 }}
//------------------------------------------------------------------------
#include "colors.inc"
#include "textures.inc"
#include "glass.inc"
#include "metals.inc"
#include "golds.inc"
#include "stones.inc"
#include "woods.inc"
#include "shapes.inc"
#include "shapes2.inc"
#include "functions.inc"
#include "math.inc"
#include "transforms.inc"
#declare Camera_1 = camera {angle 60
location <0.91 , 0.7 ,-1.6>
right x*image_width/image_height
look_at < 0.15 , 0.0 , -0.135>}
camera{Camera_1}
//------------------------------------------------------------------------
// sun -------------------------------------------------------------------
light_source{<-1500,2500,-2500> color White*0.9 }
// sky -------------------------------------------------------------------
#local Sky_Dimmer = 0.25;
sky_sphere { pigment { gradient <0,1,0>
color_map { [0.00 rgb <1.0,1.0,1.0>*Sky_Dimmer]
[0.30 rgb <0.0,0.1,1.0>*Sky_Dimmer]
[0.70 rgb <0.0,0.1,1.0>*Sky_Dimmer]
[1.00 rgb <1.0,1.0,1.0>*Sky_Dimmer]
}
scale 2
}
}
// поверхность
plane { <0,1,0>, 0
texture {
pigment { gradient <0,2,3>
color_map { [0.00 rgb <1.0,1.0,1.0>*Sky_Dimmer]
[0.20 rgb <0.8,0.8,0.8>*Sky_Dimmer]
[0.40 rgb <0.4,0.4,0.4>*Sky_Dimmer]
[1.00 rgb <0.9,0.9,0.9>*1]
}
scale 40
}
}
rotate<0,0,0>
translate<1,0,-35>
}
//--------------------------------------------------------------------------
//---------------------------- objects in scene ----------------------------
//--------------------------------------------------------------------------
//-----------------------------------------
// создание стакана
#macro Glass_01( G_R, // радиус
G_H, // высота
) //------------------------
difference{
cylinder{<0, 0,0>,<0,G_H ,0>,G_R }
cylinder{<0,G_R*.05,0>,<0,G_H+.1,0>,G_R*.9}
}
#end
//-----------------------------------------
//-----------------------------------------
global_settings{max_trace_level 10}
//-----------------------------------------
union{
object{ Glass_01( 0.14, // радиус
0.35, // высота
) //-----------------------
material{
texture{
pigment{ rgbf<.7,.7,.7,0.95>*1}
finish { ambient 0.0
diffuse 0.15
reflection 0.2
specular 0.6
roughness 0.005
reflection { 0.03, 1.0 fresnel on }
}
}
interior{ ior 1.5
fade_power 1001
fade_distance 0.5
fade_color <0.8,0.8,0.8>
}
}
}
// вода
intersection{
cylinder{<0,0,0>,<0,0.35*0.85,0>,0.14
material{
texture{
pigment{ rgbf<.1,.1,.7,0.9>*0.95}
normal { ripples 1.35 scale 0.0125 turbulence 0.3 translate<-0.05,0,0> rotate<0,-20,0>}
finish { ambient 0.0
diffuse 0.15
reflection 0.2
specular 0.6
roughness 0.005
reflection { 0.2, 1.0 fresnel on }
conserve_energy
}
}
interior{ ior 1.33
fade_power 1001
fade_distance 0.5
fade_color <0.8,0.8,0.8>
}
}
} //
cylinder{<0,0.14*0.051,0>,<0,1,0>,0.14*0.90 *0.999
material{
texture{
pigment{ rgbf<.93,.95,.98,0.825>*0.99}
finish { ambient 0.0
diffuse 0.15
reflection 0.2
specular 0.6
roughness 0.005
reflection { 0.17, 1.0 fresnel on }
conserve_energy
}
}
interior{ ior 3.0
fade_power 1001
fade_distance 0.5
fade_color <0.8,0.8,0.8>
}
}
}
}
// палочка
cylinder{<0,0,0>,<0.03,0.45,0>,0.01
texture{ pigment{ color rgb< 0.8, 0.8, 0.1>*1.5 }
finish { phong 1 reflection 0.00}
}
rotate<0,0,35> rotate<0,-20,0>
translate<0.11,0.05,0>
}
translate< 0.25,0,-0.35 >
} //------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment