|
![](/i/fill.gif) |
On Tue, 26 Jun 2007 23:25:52 -0700, Tim Attwood wrote:
>
> // usage: vector, vector, float, int, float, float, random stream
> // LOC is location of base
> // DIR is direction and magnitude of growth
> // A is the limit for a random angle of each segment
> // N is the number of segments
> // R1 is the base radius
> // R2 is the tip radius
> // rsd is a random stream to use
> #macro Tentacle(LOC, DIR, A, N, R1, R2, rsd)
> #local c = 0;
> #local loc = LOC;
> #local dir = DIR;
> blob {
> #while (c < 1 )
> #local rad = R1*(1-c)+R2*c;
> #local dx = rand(rsd)*A*2-A;
> #local dy = rand(rsd)*A*2-A;
> #local dz = rand(rsd)*A*2-A;
> #local dir = vrotate(dir,<dx,dy,dz>);
> sphere {loc, rad, 1}
> #ifdef (lastloc) cylinder {lastloc, loc, rad, 1} #end
> #local lastloc = loc;
> #local lastrad = rad;
> #local loc = loc+dir;
> #local c = c+(1/N);
> #end
> }
> #end
>
I may be missing something obvious here ... but why not use a sphere_sweep?
Post a reply to this message
|
![](/i/fill.gif) |