POV-Ray : Newsgroups : povray.binaries.images : snowflakes macro v1 [23.2kb] : Re: snowflakes macro v1 [23.2kb] Server Time
19 Nov 2024 15:44:02 EST (-0500)
  Re: snowflakes macro v1 [23.2kb]  
From: Steve
Date: 12 Dec 2001 09:57:16
Message: <slrna1es0u.vbg.steve@zero-pps.localdomain>
On Thu, 6 Dec 2001 16:49:57 -0000, Tom Melly wrote:
>What I really like about POV is if the PHB walks by, it looks like you're
>working....

I've thought since that each of your six sections will also be symetrical
within itself, so you make half of one sixth, your triangle should look 
like this:

-----
\   |
 \  |
  \ |
   \|

So you apply your randon texture of white and clear to that section, 
then double it up / flip it in a union so that you've now got a 
symetrical sixth of the flake:

----------
\   |   /
 \  |  /
  \ | /
   \|/
    V

Now rotate it in a union to get your full circle. 

OK that's a copuple of hours of my day gone now, this works:

#include "colors.inc"

#version 3.1;  
       
global_settings{   
                ambient_light 7
                assumed_gamma 2.2
               }

// ******  Basic objects, camera, plane, lights etc. ************************    

camera{
       location <0,5,-25> 
       look_at <0,3,0> 
      }	    

// *********************  Snowflake Macro ****************************

#macro Snow_Flake(Pig_Turb, Pig_Scale, Pig_Rotate)

#local Flake_Pig =
pigment{
        agate
        color_map{
                  [0.0  Clear ]
                  [0.5  Clear ]
                  [0.5  White ]
                  [1  White ]
                 } 
        turbulence Pig_Turb
        rotate z*Pig_Rotate
        scale Pig_Scale
       }


#local Flake_Half_Section =
polygon{
        4,
        <-3.5,6>, <0,5>, <0,0>, <-3.5,6>
        pigment{Flake_Pig}
       }

#local Flake_Section =
union{
      object{Flake_Half_Section}
      object{Flake_Half_Section rotate y*180}
     }

union{
      object{Flake_Section}
      object{Flake_Section rotate z*60}
      object{Flake_Section rotate z*120}
      object{Flake_Section rotate z*180}
      object{Flake_Section rotate z*240}
      object{Flake_Section rotate z*300}
     }
#end

// ****************** Lay objects out for display **************

object{Snow_Flake(0.75, 0.75, 0) translate <-8,5,0>}
object{Snow_Flake(0.75, 0.75, 0) rotate z*30 scale 0.85 translate <-8,5,0>}

object{Snow_Flake(0.5, 0.5, 30) scale 0.75  translate <4,-2,0>}
object{Snow_Flake(0.14, 1, 30) scale 0.5  translate <5,7,0>}


Post a reply to this message


Attachments:
Download 'snowflake.jpg' (15 KB)

Preview of image 'snowflake.jpg'
snowflake.jpg


 

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