POV-Ray : Newsgroups : povray.binaries.images : Check out the new signature : Re: Check out the new signature Server Time
16 Aug 2024 04:19:17 EDT (-0400)
  Re: Check out the new signature  
From:
Date: 22 Mar 2002 03:36:01
Message: <5hql9ug1n6hdikqds951ct0ait9suu3tko@4ax.com>
On Fri, 22 Mar 2002 01:28:09 -0500, "Sir Charles W. Shults III"
<aic### [at] cflrrcom> wrote:
>    I thought I would try my hand at a sig file, since everyone else seems
> to have one.

Ok, my notes

>#declare Z=texture{pigment{crackle}finish{specular.5}};

use #local instead of #declare
use #default to avoid texture in objects
don't use texture if you not use light (or use it with visible values
if you use black objects on black background then good luck ;-)

> #macro B(a,b) box{ -.5,.5translate<a,b,0>texture{Z}}#end

default camera is at z=0 so move your object somewhere deeper (z>0)
if you use #default then you can avoid texture in object at all
it could more confuse when _ would be used instead of B

> #macro C(a,b)sphere{0,.5 translate<a,b,-.5>texture {Z}}#end

default camera is at z=0 so move your object somewhere deeper (z>0)
if you use #default then you can avoid texture in object at all
no need to translate sphere, just use translation as center

> #macro N(a,c)
> #declare k=0;

use #local

> #while(k<6)

 if you want small loop then recursion saves a lot of space

> #if((c/2)!=int(c/2))

 can be replaced with one mod(c,2) calculation

> B(a,k-1)
> B(-a,-k+1)

have you noticed that both calls have 1 and -1 factor for parameters ?
so put only factor to macro, and multi[ply parameters inside macro

> #end
> #declare c=int(c/2);
> #declare k=k+1;

use #local or even replace #while with recursion
and remove declarations at all

> #end
> #end
> N(-6,7)N(-5,5)N(-4,1)N(-3,31)N(-2,4)N(-1,7)
> C(-1,-3)C(1,3)//chip

no need to declare macro C and use it twice, space of this macro is larger
then two unrolled spheres.

Finally check my version of your macro. Feel free to add apropriate light and
pigment :-)

#macro c(h,i,p)#if(i<6)c(int(h/2)i+1p)#if(mod(h,2))_(1)_(-1)#end#end#end//chip
background{1}#macro _(s)box{-.5,.5translate<s*p,s*i-s,19>}#end sphere{<1,3,19>
.5}sphere{<-1,-3,19>.5}c(7,0,-6)c(5,0,-5)c(1,0,-4)c(31,0,-3)c(4,0,-2)c(7,0,-1)

ABX


Post a reply to this message

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