//=========================================================================== // COMPACT.POV // // Compact Disc, Jewel Case, Liner // // (C) Copyright 1998 by Gary Ruben, P.O. Box 35219, Brighton MA // #ifndef (CDISC_INC) #declare CDISC_INC = 1 //=========================================================================== // Include "standard" materials and other object models // // ==== Standard POV-Ray Includes ==== #include "colors.inc" // Standard Color definitions #include "textures.inc" // Standard Texture definitions // ==== Additional Includes ==== #include "STONES.INC" #declare StandardLighting = union { light_source { 0*x Gray80 translate <-2000, 2000, -2000> } light_source { 0*x Gray80 translate < 2000, 2000, -2000> } light_source { 0*x Gray80 translate <-2000, -2000, -2000> } light_source { 0*x Gray80 translate < 2000, -2000, -2000> } } //=========================================================================== // Model of OBJECT // //==== Finishes ======================= #declare F_Acrylic = finish { ambient 0.1 diffuse 0.6 specular 1 roughness 0.001 reflection 0.25 refraction 1 ior 1.05 phong 1 phong_size 300 fade_distance 0.5 fade_power 1 } #declare F_Acrylic2 = finish { ambient 0.9 diffuse 0.9 specular 0.25 roughness 0.0001 brilliance 10 reflection 0.1 refraction 1 ior 1.05 phong 1 phong_size 5 fade_distance 0.125 fade_power 1 } #declare F_Liner = finish { phong 0.8 phong_size 200 specular 0.3 roughness 0.001 reflection 0.01 //ambient 0.4 //diffuse 0.7 } //==== Textures ======================= #declare T_Insert = texture { pigment { Black } finish { phong 0.8 phong_size 100 specular 0.8 roughness 0.1 reflection 0.05 diffuse 0.9 } } #declare T_InsertRibs = texture { T_Insert normal { gradient x, 0.20 scale <1,0.001,1> frequency 32 triangle_wave } } #declare T_Hub = texture { pigment { Black } finish { phong 0.95 phong_size 300 specular 0.6 roughness 0.001 reflection 0.1 } } #declare T_Acrylic = texture { pigment { color rgb <1.0, 1.0, 0.98> transmit 0.93 } finish { F_Acrylic } } #declare T_AcrylicRibs = texture { pigment { White transmit 0.90 } finish { F_Acrylic caustics 1 } normal { gradient x, 0.20 scale <1,1,0.001> frequency 32 triangle_wave } } #declare T_Mylar = texture { pigment { Silver } finish { ambient 0.15 diffuse 0.26 specular 0.90 roughness 0.001 brilliance 10 reflection 0.95 //rgbf <0.95, 0.95, 0.95, 0.85> metallic } } #declare T_Diffraction = texture { pigment { radial frequency 12 ramp_wave color_map { [0.000 color rgbt <1.000, 0.000, 0.500, 0.90> ] [0.100 color rgbt <0.500, 0.000, 1.000, 0.90> ] [0.200 color rgbt <0.000, 0.000, 1.000, 0.90> ] [0.300 color rgbt <0.000, 0.500, 1.000, 0.90> ] [0.400 color rgbt <0.000, 1.000, 1.000, 0.90> ] [0.500 color rgbt <0.000, 1.000, 0.500, 0.90> ] [0.600 color rgbt <0.000, 1.000, 0.000, 0.90> ] [0.700 color rgbt <0.500, 1.000, 0.000, 0.90> ] [0.800 color rgbt <1.000, 1.000, 0.000, 0.90> ] [0.900 color rgbt <1.000, 0.500, 0.000, 0.90> ] [1.000 color rgbt <1.000, 0.000, 0.000, 0.90> ] } rotate -15*y } finish { ambient 1 diffuse 0 phong 0 specular 0 } } #declare T_Liner = texture { pigment { White } finish { F_Liner } normal { bumps 0.01 } } #ifndef ( I_LinerTop ) #declare I_LinerTop = "CDLinerTop.gif" #end #declare T_LinerTop = texture { pigment { image_map { gif I_LinerTop map_type 0 interpolate 2 once } } finish { F_Liner } rotate 90*x scale <4.70, 1, 4.63> } #ifndef ( I_LinerBtm ) #declare I_LinerBtm = "CDLinerTop.gif" #end #declare T_LinerBtm = texture { pigment { image_map { gif I_LinerBtm map_type 0 interpolate 2 once } } finish { F_Liner } rotate 90*x rotate 180*z scale <4.70, 1, 4.63> translate 4.70*x } //==== Transforms ===================== #declare X_LID_CLOSED = transform { translate 0 } #declare X_LID_HALF_OPEN = transform { translate <-0.2, -0.2,0> rotate 35*z translate <0.2,0.2,0> } #declare X_LID_WIDE_OPEN = transform { translate <-0.2, -0.2,0> rotate 125*z translate <0.2,0.2,0> } #declare X_LID_OPEN = transform { translate <-0.2, -0.2,0> rotate 180*z translate <0.2,0.2,0> } //==== Objects ======================== //------------------------------------- // The CD Holder Insert //------------------------------------- #declare BaseInsert = union { difference { box { <0,0,0> <5.48,0.35,4.575> } union { box { <0.45,0.175,-0.1> <5.43,0.400,4.80> } box { <5.42,0.250,-0.1> <5.49,0.360,4.80> } box { <0.45,0.170,0.05> <5.43,0.185,4.75> } box { <-0.01,-0.01,-0.01> <0.40,0.30,4.58> } cylinder { 0.05*y, 0.400*y, 2.45 translate <2.95, 0.0, 2.25> } cylinder { -1*y, 1*y, 0.5 translate <2.95, 0.0, 2.25> } cylinder { 0.1*y, 0.5*y, 0.245 translate <1.25, 0, 0> } cylinder { 0.1*y, 0.5*y, 0.245 translate <4.60, 0, 0> } cylinder { 0.1*y, 0.5*y, 0.245 translate <1.25, 0, 4.575> } cylinder { 0.1*y, 0.5*y, 0.245 translate <4.60, 0, 4.575> } cylinder { <5.4,0.25,0.95>,<5.5,0.25,0.95>, 0.075 } cylinder { <5.4,0.25,3.7>,<5.5,0.25,3.7>, 0.075 } } texture { T_Insert } } box { <0,0.35,0> <0.45,0.351,4.575> texture { T_InsertRibs } } } //------------------------------------- #declare BaseHub = difference { union { difference { cone { 0.05*y, 0.575, 0.075*y, 0.45 } cylinder { 0*y, 1*y, 0.25 } } difference { cylinder { 0.05*y, 0.15*y, 0.25 } cylinder { 0*y, 1*y, 0.15 } } } #declare RA = 0 union { #while (RA < 12) box { <-0.015,0,0> <0.015,1,0.4> rotate 30*RA*y } #declare RA = RA + 1 #end } texture { T_Hub } translate <2.95, 0.0, 2.25> } //------------------------------------- #declare Insert = union { object { BaseInsert } object { BaseHub } translate 0.05*y } //------------------------------------- // The Case Pieces //------------------------------------- #declare CaseBottom = merge { difference { box { <0.00,0.05,-0.05> <5.53,0.35,4.58> } union { box { <0.00,0.00, 0.00> <5.48,0.35,4.575> } box { <0.45,0.180,-0.1> <5.48,0.400,4.80> } box { <5.48,0.300,-0.1> <5.60,0.400,4.80> } box { <2.10,0.060,-1.0> <3.85,0.500,6.00> } cylinder { 0.15*y, 0.5*y, 0.245 translate <1.25, 0, 0> } cylinder { 0.15*y, 0.5*y, 0.245 translate <4.60, 0, 0> } cylinder { 0.15*y, 0.5*y, 0.245 translate <1.25, 0, 4.575> } cylinder { 0.15*y, 0.5*y, 0.245 translate <4.60, 0, 4.575> } cylinder { <0.2, 0.2, -1>, <0.2, 0.2, 6> 0.05 } cylinder { <0.6, 0.125, -1> <0.6, 0.125, 6> 0.025 } cylinder { <4.0, 0.125, -1> <4.0, 0.125, 6> 0.025 } cylinder { <5.2, 0.125, -1> <5.2, 0.125, 6> 0.025 } } } box { <0.00,0.00,-0.10> <5.58,0.05,4.63> } texture { T_Acrylic } } //------------------------------------- #declare LidTab = difference { cylinder { 0*y, 0.04*y, 0.225 } plane { z, 0 } } //------------------------------------- #declare CaseLid = difference { merge { box { <0.47,0.35,-0.05> <5.58,0.40, 4.58> } // top plate box { <0.00,0.06,-0.10> <5.58,0.40,-0.05> } // near side box { <0.05,0.06,-0.1001> <5.53,0.35,-0.11> texture { T_AcrylicRibs } } box { <0.00,0.06, 4.58> <5.58,0.40, 4.63> } // far side box { <0.05,0.06, 4.6301> <5.53,0.35, 4.64> texture { T_AcrylicRibs} } box { <0.53,0.30,-0.05> <0.58,0.35, 4.58> } // inside lip near hinge box { <5.33,0.325,0.65> <5.355,0.35,1.45> } // inside lip at open end box { <5.33,0.325,3.25> <5.355,0.35,4.10> } // inside lip at open end cylinder { <0.2, 0.2, -0.05>, <0.2, 0.2, 0> 0.05 } // near hinge cylinder { <0.2, 0.2, 4.53>, <0.2, 0.2, 4.58> 0.05 } // far hinge object { LidTab translate <1.325,0.20,-0.05> } object { LidTab translate <4.575,0.20,-0.05> } object { LidTab rotate 180*y translate <1.325,0.20,4.58> } object { LidTab rotate 180*y translate <4.575,0.20,4.58> } } union { box { <0,-1,-1> <0.14,1,6> rotate 45*z } // bevel trim off hinge box { <1.10,0.25,-1> <1.55,0.3499,6> } // hole at tab box { <4.35,0.25,-1> <4.80,0.3499,6> } // hole at tab } texture { T_Acrylic } } //------------------------------------- // The Liner Notes //------------------------------------- #declare Staple = difference { torus { 0.25, 0.015 } plane { -x, 0 } scale <0.1, 1, 1> texture { Aluminum} } //------------------------------------- #declare TopLinerPage = box { <0.00,0.00,0.00> <4.70,0.01,4.63> } //------------------------------------- #declare TopLiner = union { object { TopLinerPage texture{ T_LinerBtm } } object { TopLinerPage texture{ T_Liner } translate 0.01*y } object { TopLinerPage texture{ T_Liner } translate 0.02*y } object { TopLinerPage texture{ T_LinerTop } translate 0.03*y } object { Staple translate <-0.01,0.01,1.2> } object { Staple translate <-0.01,0.01,3.3> } } //------------------------------------- // The Whole Jewel Case [Lid, Bottom, Insert & Liner] //------------------------------------- #declare X_POS = transform { X_LID_WIDE_OPEN } #declare JewelCase = union { object { Insert } object { CaseBottom } //object { CaseLid transform X_POS } union { object { TopLiner translate <0.60, 0.35, -0.05> } object { CaseLid } transform X_POS } translate <-3.0,0.0,-2.35> // make center at center of hub } //------------------------------------- // The CD //------------------------------------- #declare DiffractionWedge = intersection { difference { cylinder { 0.02500*y, 0.02513*y, 2.265 } cylinder { -1*y, 1*y, 0.8125 } } intersection { box { <0,-1,0> <-5,1,-5> rotate -15*y } box { <0,-1,0> <-5,1,5> rotate -45*y } } } //------------------------------------- #declare DiffractionRainbow = union { object { DiffractionWedge } object { DiffractionWedge rotate 180*y } texture { T_Diffraction } } //------------------------------------- #declare CompactDisc = union { merge { difference { cylinder { 0*y, 0.05*y, 2.325 } cylinder { -1*y, 1*y, 0.2875 } } torus { 2.325, 0.025 } difference { cylinder { 0.05*y, 0.06*y, 0.70 } cylinder { -1*y, 1*y, 0.65 } } texture { pigment { color rgb <0.99, 0.99, 0.90> transmit 0.97 } finish { F_Acrylic2 } } } difference { cylinder { 0.0249*y, 0.0251*y, 2.30 } cylinder { -1*y, 1*y, 0.7875 } texture { T_Mylar } } object { DiffractionRainbow } } //=========================================================================== // If this is not part of a larger model or scene, show the model as a // standalone object // #ifdef (COMPOSITE_MODEL) #declare NO_DISC_MODELS = true #end #ifndef (NO_DISC_MODELS) light_source { StandardLighting } sky_sphere { pigment { gradient y color_map { [0.0 color blue 0.6] [1.0 color rgb <0.8,0.8,1>] } } } plane { y, 0 texture { pigment { Brown_Agate } } } camera { up 1*y right 4*x/3 location <0, 3, -8> look_at <0,0,0> } cylinder { <0,0,10>, <0,5,10>, 2.5 texture { T_Stone18 } } cylinder { <2,0,6>, <2,5,6>, 1 texture { T_Stone21 } } cylinder { <-2,0,7>, <-2,6,7>, 0.5 texture { T_Stone31 } } union { object { JewelCase rotate 30*y } object { CompactDisc translate 0.10*y } translate -2*z } #end #end