POV-Ray : Newsgroups : povray.text.scene-files : Little Horn macro Server Time
31 Oct 2024 21:26:18 EDT (-0400)
  Little Horn macro (Message 1 to 2 of 2)  
From: Gilles Tran
Subject: Little Horn macro
Date: 27 Apr 1999 12:39:09
Message: <3725DA9D.A543DA4@inapg.inra.fr>
//================================================
// Little horn macro by Gilles Tran CopyIfYouWant 1999
// This one makes a couple of horns based on spheres
// The horns have a slight bulge at the base
// but otherwise they look nice
// To find somebody to put these horns on
// may prove more difficult.
//================================================
// hradius_start = horn radius at start
// hradius_end = horn radius at the end (0= very pointy horn)
// hsize = of length of horn if straight
// hangle = how much the horn is curved
// hinter=interval between horns
// n = nb of horn elements
//================================================
// the horns are in the x-y plane
//================================================
#macro mHorns(hradius_start,hradius_end,hsize,hangle,hinter,n)
//#local hcol_start=Yellow*0.5; // start color - uncomment if you want a
gradient pigment
//#local hcol_end=Black; // end color
#local OneHorn=
union{
        #local lseg=pi*hsize/n;
        #local i=0;
        #local r1=hradius_start;
        #local P=<0,0,0>;
        #while (i<=n)
                #local r = hradius_start + (hradius_end -
hradius_start)*i/n;
                sphere{P,r
//                uncomment the following line if you want a gradient
pigment
//                texture{pigment{hcol_start + (hcol_end -
hcol_start)*i/n} finish{ambient 1 specular 1 roughness 0.05}}
                }
                #if(i=0) #local P=x*lseg; #else #local
P=P+lseg*(vnormalize(vrotate(P,z*hangle*i/n)));#end
                #local i=i+1;
        #end
}
union{
        object{OneHorn translate x*hinter*0.5}
        object{OneHorn translate x*hinter*0.5 scale <-1,1,1>}
}
#end
//================================================
// examples
//================================================
#include "colors.inc"
camera{location  <1.0, 5, -30.0> direction 1.5*z right 4/3*x  look_at
<0.0, 5,  0.0>}
light_source{<-30, 30, -30> color Cyan}
light_source{<30, 30, -30> color White*2}

// crossed horns (hangle=120)
//object{mHorns(2,0.2,5,120,5,200) texture{pigment{rgb<1,0.7,0.3>}
finish{metallic brilliance 5 ambient 0.01 phong 1}}}

// closed horns (hangle=90)
object{mHorns(2,0.2,5,90,5,200) texture{pigment{rgb<1,0.7,0.3>}
finish{metallic brilliance 5 ambient 0.01 phong 1}}}

// open horns (hangle=40)
//object{mHorns(2,0.2,5,40,5,200) texture{pigment{rgb<1,0.7,0.3>}
finish{metallic brilliance 5 ambient 0.01 phong 1}}}

background{White}


Post a reply to this message

From: Spider
Subject: Re: Little Horn macro
Date: 27 Apr 1999 16:04:44
Message: <3725EF08.A962794A@bahnhof.se>
Thanks :-)
taking a looki look :-)

Gilles Tran wrote:
> 
> //================================================
> // Little horn macro by Gilles Tran CopyIfYouWant 1999
> // This one makes a couple of horns based on spheres
> // The horns have a slight bulge at the base
> // but otherwise they look nice
> // To find somebody to put these horns on
> // may prove more difficult.


-- 
//Spider
        [ spi### [at] bahnhofse ]-[ http://www.bahnhof.se/~spider/ ]
What I can do and what I could do, I just don't know anymore
                "Marian"
        By: "Sisters Of Mercy"


Post a reply to this message

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