POV-Ray : Newsgroups : povray.binaries.scene-files : anemone macro : Re: anemone macro Server Time
1 Sep 2024 10:23:06 EDT (-0400)
  Re: anemone macro  
From: bob
Date: 4 Jul 2007 12:04:36
Message: <pan.2007.07.04.15.14.31.532986@almost.bestweb.net>
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

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