POV-Ray : Newsgroups : povray.text.scene-files : RSOCP Merry Christmas Server Time
31 Oct 2024 21:26:03 EDT (-0400)
  RSOCP Merry Christmas (Message 1 to 1 of 1)  
From: Paolo Gibellini
Subject: RSOCP Merry Christmas
Date: 19 Dec 2005 08:09:00
Message: <43a6b0ec@news.povray.org>
The spheres:

// Param ----------------------------------
#declare word1="MERRY";
#declare word2="CHRISTMAS";
#declare font="tahoma.ttf";
#declare r=0.5; // Sphere radius

#declare i1=strlen(word1);
#declare i2=strlen(word2);
// ----------------------------------------


// Reflective spheres related -------------
#declare t_r=  texture {
    pigment {
      color rgb <0.8,0.4,0.4>
    }
    finish{
      diffuse 0.3
      ambient 0.0
      specular 0.6
      reflection {
        0.8
        metallic
      }
      conserve_energy
    }
}

// row 1
#declare i=0;
#while (i<i1)
 #declare txt=object{text {ttf font substr(word1,i+1,1) 1,0} scale
<1,1,0.25>*0.6 }
 difference {
  sphere {0, r}
  object {txt translate
<-(max_extent(txt).x-min_extent(txt).x)/2,-(max_extent(txt).y-min_extent(txt
).y)/2,-0.5-(max_extent(txt).z-min_extent(txt).z)/2>}
  texture{t_r}
  //translate <i-i1/2+r,3*r-(sqrt(3)-1)*r/2,0> //tangent
  translate <i-i1/2+r,2*r,0> // I prefer this
 }
 #declare i=i+1;
#end

// row 2
#declare i=0;
#while (i<i2)
 #declare txt=object{text {ttf font substr(word2,i+1,1) 1,0} scale
<1,1,0.25>*0.6 }
 difference {
  sphere {0, r}
  object {txt translate
<-(max_extent(txt).x-min_extent(txt).x)/2,-(max_extent(txt).y-min_extent(txt
).y)/2,-0.5-(max_extent(txt).z-min_extent(txt).z)/2>}
  texture{t_r}
  translate <i-i2/2,r,0>
 }
 #declare i=i+1;
#end
// ----------------------------------------


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.