Skip to content

Instantly share code, notes, and snippets.

@pciet
Created May 11, 2020 14:21
Show Gist options
  • Save pciet/2a5a94f1008967bdfbe7740e077645d1 to your computer and use it in GitHub Desktop.
Save pciet/2a5a94f1008967bdfbe7740e077645d1 to your computer and use it in GitHub Desktop.
The source code for the cover of my "Text" electronic music album.
#version 3.7;
global_settings {
assumed_gamma 1.0
ambient_light 0
}
camera {
location <-9,-9,0>
up <0,0,1>
right <1,0,0>
sky <0,0,1>
look_at <9,9,-4>
}
#declare TableMaterial = material {
texture {
pigment { rgbf <0.55,0.78,0.9,0.7> }
finish {
reflection 0.2
specular 0.99
roughness 0.001
diffuse 0.2
}
}
interior {
ior 2.4
dispersion 1.1
caustics 0.7
}
}
#declare WallMaterial = material {
texture {
pigment { rgb <0.45,0.78,0.4> }
finish {
specular 0.01
roughness 0.5
diffuse 0.2
}
}
}
background {
color rgb <0,0,0>
}
light_source {
<75,5,0>, rgb <0.47,0.48,0.49>
}
light_source {
<0,100,0>, rgb <0.5,0.46,0.47>
}
light_source {
<-3,-5,5>, rgb <0.03,0.02,0.02>
}
sky_sphere {
pigment {
bozo
color_map {
[0.8 rgb 0][1 rgb 1]
}
scale 0.001
}
}
#declare BoxTrimSphereRad = 0.01;
#declare BoxTrimRad = 0.01;
#declare TopUpRight = <1,1,1>;
#declare TopUpLeft = <-1,1,1>;
#declare TopDownRight = <1,-1,1>;
#declare TopDownLeft = <-1,-1,1>;
#declare BottomUpRight = <1,1,-1>;
#declare BottomUpLeft = <-1,1,-1>;
#declare BottomDownRight = <1,-1,-1>;
#declare BottomDownLeft = <-1,-1,-1>;
#macro BoxSphere(Center)
sphere {
Center, BoxTrimSphereRad
}
#end
#macro BoxTrim(Start, Finish)
cylinder {
Start, Finish, BoxTrimRad
}
#end
#declare Box = object {
merge {
box {
TopUpRight,BottomDownLeft
}
BoxSphere(TopUpRight)
BoxSphere(TopUpLeft)
BoxSphere(TopDownRight)
BoxSphere(TopDownLeft)
BoxSphere(BottomUpRight)
BoxSphere(BottomUpLeft)
BoxSphere(BottomDownRight)
BoxSphere(BottomDownLeft)
BoxTrim(TopUpRight,TopUpLeft)
BoxTrim(TopUpRight,BottomUpRight)
BoxTrim(TopUpRight,TopDownRight)
BoxTrim(TopDownRight,TopDownLeft)
BoxTrim(TopDownRight,BottomDownRight)
BoxTrim(TopDownLeft,TopUpLeft)
BoxTrim(TopDownLeft,BottomDownLeft)
BoxTrim(BottomDownRight,BottomUpRight)
BoxTrim(BottomDownRight,BottomDownLeft)
BoxTrim(BottomDownLeft,BottomUpLeft)
BoxTrim(BottomUpLeft,BottomUpRight)
BoxTrim(BottomUpLeft,TopUpLeft)
}
}
object {
difference {
object {
Box
scale 10
}
object {
Box
scale 9
}
object {
Box
scale <2,2,5>
translate <0,9.5,0>
}
object {
Box
scale <2,2,5>
translate <9.5,0,0>
}
}
material { WallMaterial }
}
object {
merge {
object {
Box
scale <3,3,0.2>
rotate <31,0,31>
}
object {
Box
scale <3.5,3.5,0.4>
rotate <90,0,31>
translate <0,0,-3>
}
}
rotate <0,0,-145>
translate <0,0,-2>
material { TableMaterial }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment