POV-Ray : Newsgroups : povray.advanced-users : movie within : Re: movie within Server Time
29 Jul 2024 04:17:37 EDT (-0400)
  Re: movie within  
From: Dan P
Date: 6 Feb 2004 20:34:02
Message: <4024408a$1@news.povray.org>
Just for kicks, here is the code I used to create the snowflakes in case
anybody might find it useful:


#include "colors.inc"
#include "shapes.inc"
#include "rand.inc"



#declare BAR_WIDTH = 0.04;
#declare BAR_EDGE = 0.04;



background
{
 color rgb <0, 0, 0>
}



camera
{
 location <0, 0, -1>
 look_at <0, 0, 0>

 up y
 right image_width / image_height * x
}



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



#macro FlakeBar(n)

 merge
 {
  cone { <0, 0, 0>, BAR_WIDTH, <0, 1, 0>, 0 }

  #local i = 0;

  #local RN = seed(n);

  #while (i < 4)

   #local by = rand(RN);
   #local bl = rand(RN) * 0.3 + 0.1;

   cone { <0, 0, 0>, BAR_WIDTH, <0, bl, 0>, 0 rotate 45*z translate by*y }
   cone { <0, 0, 0>, BAR_WIDTH, <0, bl, 0>, 0 rotate -45*z translate by*y }

   #local i = i + 1;

  #end
 }

#end




#macro Flake(n)

 object { FlakeBar(n) }
 object { FlakeBar(n) rotate 60*z }
 object { FlakeBar(n) rotate 120*z }
 object { FlakeBar(n) rotate 180*z }
 object { FlakeBar(n) rotate 240*z }
 object { FlakeBar(n) rotate 300*z }

#end



#macro SnowFlake()

 merge
 {
  Flake(ceil(rand(RdmA)*65535))

  pigment
  {
   color rgbf <0.5, 0.5, 0.5, 1>
  }


  finish
  {
   specular 1
  }


  scale <0.05, 0.05, 0.05>
 }

#end



#local i = 0;

#while (i < 1024)

 object { SnowFlake() rotate <RRand(-30, 30, RdmA), RRand(-30, 30, RdmA),
RRand(-30, 30, RdmA)> translate VRand_In_Sphere(RdmA) }

 #local i = i + 1;

#end


Post a reply to this message

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