Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // https://commons.wikimedia.org/wiki/Category:Cube_subspaces_(black_in_gray)
- #version 3.6;
- global_settings { assumed_gamma 1.0 }
- #default{ finish{ ambient 0.1 diffuse 0.9 conserve_energy}}
- #include "colors.inc"
- #include "math.inc"
- ///////////////////////////// camera and light
- #declare Camera_Position = <10, 15, -50>;
- camera{
- location Camera_Position
- right x*image_width/image_height
- angle 6.7
- look_at <-0.05, -0.10, -0.07>
- }
- light_source{ <-400, 500, -300> color White*0.9 shadowless}
- light_source{ Camera_Position color rgb<0.9,0.9,1>*0.1 shadowless}
- sky_sphere{ pigment{ White } }
- ///////////////////////////// variables
- #declare SkeletonColor = rgb<.8, .8, .8>;
- #declare SubspaceColor = rgb<.05, .05, .05>;
- #declare SubspaceColorTransp = rgbt<.05, .05, .05, .1>;
- #declare SkeletonRad = .03;
- #declare SubspaceRad = .09;
- // cube coordinates
- #declare A = 2.25;
- #declare CC = array[8]{<-A,A,A>, <A,A,A>, <-A,-A,A>, <A,-A,A>, <-A,A,-A>, <A,A,-A>, <-A,-A,-A>, <A,-A,-A>}
- #declare CubeEdgesAbstractCoordinates = array[12][2]{
- {0,1}, {2,3}, {4,5}, {6,7}, {0,2}, {1,3}, {4,6}, {5,7}, {0,4}, {1,5}, {2,6}, {3,7}
- }
- ///////////////////////////// skeleton cube
- #declare Skeleton = union{
- #for(i, 0, 7)
- sphere{CC[i], 2*SkeletonRad}
- #end
- #for(i, 0, 11)
- cylinder{
- CC[CubeEdgesAbstractCoordinates[i][0]],
- CC[CubeEdgesAbstractCoordinates[i][1]],
- SkeletonRad
- }
- #end
- pigment{color SkeletonColor}
- }
- ///////////////////////////// subspaces
- #declare Square = union{
- union{
- sphere{ <0,A,A>, 2*SubspaceRad }
- sphere{ <0,-A,A>, 2*SubspaceRad }
- sphere{ <0,-A,-A>, 2*SubspaceRad }
- sphere{ <0,A,-A>, 2*SubspaceRad }
- cylinder{ <0,A,A>, <0,-A,A>, SubspaceRad }
- cylinder{ <0,-A,A>, <0,-A,-A>, SubspaceRad }
- cylinder{ <0,-A,-A>, <0,A,-A>, SubspaceRad }
- cylinder{ <0,A,-A>, <0,A,A>, SubspaceRad }
- pigment{color SubspaceColor}
- }
- polygon{ 5, <0,A,A>, <0,-A,A>, <0,-A,-A>, <0,A,-A>, <0,A,A>
- pigment{color SubspaceColorTransp}
- }
- }
- #declare Rectangle = union{
- union{
- sphere{ CC[0], 2*SubspaceRad }
- sphere{ CC[1], 2*SubspaceRad }
- sphere{ CC[7], 2*SubspaceRad }
- sphere{ CC[6], 2*SubspaceRad }
- cylinder{ CC[0], CC[1], SubspaceRad }
- cylinder{ CC[1], CC[7], SubspaceRad }
- cylinder{ CC[7], CC[6], SubspaceRad }
- cylinder{ CC[6], CC[0], SubspaceRad }
- pigment{color SubspaceColor}
- }
- polygon{ 5, CC[0], CC[1], CC[7], CC[6], CC[0]
- pigment{color SubspaceColorTransp}
- }
- }
- #declare Axis1 = union{
- cylinder{ <0,0,-A>, <0,0,A>, SubspaceRad }
- sphere{ <0,0,-A>, 2*SubspaceRad }
- sphere{ <0,0,A>, 2*SubspaceRad }
- pigment{color SubspaceColor}
- }
- #declare Axis2 = union{
- cylinder{ <0,-A,-A>, <0,A,A>, SubspaceRad }
- sphere{ <0,-A,-A>, 2*SubspaceRad }
- sphere{ <0,A,A>, 2*SubspaceRad }
- pigment{color SubspaceColor}
- }
- #declare Axis3 = union{
- cylinder{ <-A,-A,-A>, <A,A,A>, SubspaceRad }
- sphere{ <-A,-A,-A>, 2*SubspaceRad }
- sphere{ <A,A,A>, 2*SubspaceRad }
- pigment{color SubspaceColor}
- }
- #declare Origin = sphere{ <0,0,0>, SubspaceRad*2
- pigment{color SubspaceColor}
- }
- ///////////////////////////// show
- object{Skeleton}
- object{
- Rectangle
- rotate -90*y
- // The rectangle with this rotation will create '2b (rectangle) 2'.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement