POV-Ray : Newsgroups : povray.text.scene-files : Chrismas ball glitter Server Time
31 Oct 2024 14:10:22 EDT (-0400)
  Chrismas ball glitter (Message 1 to 1 of 1)  
From: Chris Huff
Subject: Chrismas ball glitter
Date: 29 Nov 1999 18:28:50
Message: <chrishuff_99-670665.18285629111999@news.povray.org>
Here is my method for making glitter on the Christmas ornaments, it is 
currently in a very early stage. It actually models each piece of 
glitter as a box, so uses quite a bit of memory. I need to make a real 
model of a ball instead of a simple sphere, and work on the textures, as 
well as packing everything into a set of macros. Another thing I need to 
do is add multiple distribution patterns.
Also, I will experiment with different shapes for the glitter, like 
triangles or small meshes, and different types, like metallic or 
frosted. Right now it looks kind of like the glitter in one of those 
"snow globes" filled with a clear liquid(usually glycerin, water, or 
oil) and a small amount of glitter that swirls around when the ornament 
is shaken.
It might be easier to use a couple layered slope-dependant textures for 
the glitter, it would certainly use less memory.

#include "colors.inc"
#version 3.1;
//-------------------------------------------
global_settings {
   assumed_gamma 1.8
}
camera {
   location < 0, 0.01, -8 >
   angle 25
   look_at < 0, 0, 0 >
}
//*******************************************
#declare BallColor = color Red;
#declare sprinkleNum = 5000;
#declare sprinkleSize = 0.035;
#declare sprinkleStream = seed(523098);
#macro ChristmasBall(hanarPosition)
   sphere  {< 0, 0, 0>, 1
      texture {
         pigment {color BallColor}
         finish {reflection 0.175 brilliance 3}
      }
   }
   #local k=0;
   #while(k<sprinkleNum)
      box 
{<-sprinkleSize/2,-sprinkleSize/2,-sprinkleSize/2>,<sprinkleSize/2,sprink
leSize/2,sprinkleSize/2>
         texture {
            pigment {color White}
            finish {
               specular 1
//             brilliance 2
            }
         }
         rotate <rand(sprinkleStream)*360,0,rand(sprinkleStream)*360>
         translate x*1
//       rotate <0,0,cos((rand(sprinkleStream)*2-1)*pi)*90>
         rotate <0,0,cos(k/sprinkleNum*pi*0.5)*90>
         rotate <0,rand(sprinkleStream)*360,0>
      }
      #local k=k+1;
   #end
#end
//*******************************************
ChristmasBall(< 0, 1, 0>)
//*******************************************

light_source {<-20, 25, -100 > color White}

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

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