POV-Ray : Newsgroups : povray.general : Help creating a 5-pointed gem like star : Re: Help creating a 5-pointed gem like star Server Time
2 Aug 2024 10:22:36 EDT (-0400)
  Re: Help creating a 5-pointed gem like star  
From: busabus
Date: 15 Nov 2004 09:50:00
Message: <web.4198c12c8348af12abbc0b2f0@news.povray.org>
"Tom Melly" <pov### [at] tomandlucouk> wrote:
> "busabus" <nomail@nomail> wrote in message
> news:web.4194a37fc3889db3abbc0b2f0@news.povray.org...
>
> > and it's bugging me.  I know I could create it by calculating the points
> > and putting them into a mesh, but there must be a simpler way of getting
>
> The more I think about this the more I think a mesh is the way to go.
>
> Not really that hard - build your mesh using a macro.

Thanks to everyone for their help on this.  I ended up going down the
intersection route by cutting a cube into what I'd call a sloped three
sided pyramid, then squashing it, copying it, squashing that and copying
that.

#include "glass.inc"

camera { location  <-2, 0, -4> look_at <0, 0, 0> angle 40}
background { color rgb 1 }
light_source {<5,5,-5> colour rgb 1}


#declare starGlass =
texture {
  pigment{rgbf <1,1,0,0.8>}
  finish {F_Glass9}
}

#declare facet =
difference {
  box {<-0.5001,0.5001,0.5001> <0.5001,-0.5001,-0.5001>}
  object {
    plane {z,0}
    rotate <45,0,0>
  }
  object {
    plane {x,0}
    rotate <0,0,-45>
  }
  translate <-0.5,0.5,-0.5>
  scale<0.5,1,0.5>
  rotate<0,-45,0>

}

#declare point =
merge {
 #declare i=1;
 #while(i<=4)
 object{facet
        rotate<0,90*i,0>
        translate<0,0,0>
        }
 #declare i=i+1;
 #end
 scale<0.75,1,0.5>
}


merge{
  #declare i=1;
  #while(i<=5)
  object{point
         rotate<0,0,72*i>
         }
  #declare i=i+1;
  #end
  texture {starGlass}
  interior {I_Glass1}
  photons {
     target
     refraction on
     reflection on
   }
}

If anyone's got some comments on this code then please feel free.  Also
suggestions on getting the gem to sparkly a bit and not look like crap I
would be grateful for.

Cheers
Daniel


Post a reply to this message

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