POV-Ray : Newsgroups : povray.binaries.images : on the right side I use shampoo "TRACE" : Re: on the right side I use shampoo "TRACE" Server Time
19 Aug 2024 20:15:50 EDT (-0400)
  Re: on the right side I use shampoo "TRACE"  
From: Wlodzimierz ABX Skiba
Date: 17 Oct 2000 10:00:55
Message: <39ec5b97@news.povray.org>

>Wlodzimierz ABX Skiba wrote:
> > I know that there is similiar stuff
> > but I want check quality of some idea
> > this is my first try of universal hair generator
> It looks pretty good, can we see some code please?

#macro HairGenerator(Object,Count,Center,Range,Inside,Height)
  #local InsidePig=pigment{object{Inside color rgb 0 color rgb 1}}
  #local R0=1/sqrt(Count);
  #local way=0;
  #local theta=0;
  #while (theta<pi)
    #local way=way+2*pi*sin(theta);
    #local theta=theta+(pi/Count);
  #end
  #local part=way/Count;
  #local theta=pi/Count;
  #local last=0;
  #while (theta<pi)
    #local way=2*pi*sin(theta);
    #local startangle=-2*pi*last/way;
    #local stepangle=2*pi*part/way;
    #local way=way+last;
    #while (way>=part)
      #local way=way-part;
      #local startangle=startangle+stepangle;
      #local
PointInRange=Center+Range*<sin(theta)*cos(startangle),sin(theta)*sin(sta
rtangle),cos(theta)>;
      #local Normal=<0,0,0>;
      #local P0=trace(Object,PointInRange,Center-PointInRange,Normal);
      #if (vlength(Normal)!=0)
        #local P1=eval_pigment(InsidePig,P0);
        #if (P1.x != 0)
          cone { P0 R0 P0+Height*Normal 0 pigment { color rgb 1 } }
        #end
      #end
    #end
    #local last=way;
    #local theta=theta+(pi/Count);
  #end
#end

I plan add such parameters
1. height of hairs as pigment/pattern
2. direction of hairs as pigment/pattern
3. smoothnes of hairs as pigment/pattern
4. color of hairs as pigment/pattern

> > now I want replace cones with sphere_sweeps
> >
> Try replacing them with a few triangles and make the whole thing a
> mesh, it should render *much* faster...

yes, faster to render but not faster to parse
and I know that it should be faster, but how
interpolate sphere_sweeps to mesh ?

ABX


Post a reply to this message

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