POV-Ray : Newsgroups : povray.general : yet another sig... : Re: yet another sig... Server Time
5 Aug 2024 22:20:21 EDT (-0400)
  Re: yet another sig...  
From: Felix Wiemann
Date: 23 Jul 2002 07:26:17
Message: <3d3d3d58@news.povray.org>
Tom Melly wrote:

[quote]
#macro #A(V,B,C,R)#while(B-256)#if(V-128/B>=0)sphere{0,.5translate<C-4R-1,9>
pigment{rgb<1-C/8R/2C/8>}}#local V=V-128/B;#end#local B=B*2;#local C=C+1;#
end#end A(234,1,0,2)A(85,1,0,1)A(81,1,0,0)light_source{-5 1}//Tom Melly
[/quote]


What about this (without name):

#macro A(V,C,R)#while(C-8)#if(V-pow(2,7-C)>=0)sphere{<C-4R-1#
local V=V-pow(2,7-C);9>.5pigment{rgb<1-C/8R/2C/8>}}#end#local
C=C+1;#end#end A(234,0,2)A(85,0,1)A(81,0,0)light_source{-5 1}

Or this:

#macro A(V,C,R)#while(C-8)#if(V-pow(2,7-C)>=0)sphere{<C-4#local
V=V-pow(2,7-C);R-1 9>.5pigment{rgb<1-C/8R/2C/8>}}#end#local C=C
+1;#end#end A(234,0,2)A(85,0,1)A(81,0,0)light_source{-5 1} //TM

Or this:

#macro A(V,C,R)#while(C-8)#if(V-pow(2,7-C)>=0)sphere{<C-4R-1#local
V=V-pow(2,7-C);9>.5pigment{rgb<1-C/8R/2C/8>}}#end#local C=C+1;#end
#end A(234,0,2)A(85,0,1)A(81,0,0)light_source{-5 1}   // Tom Melly

The parameter B has been completely removed.

I doubt if the mathematics are necessary. There is probably a much simpler 
and shorter way: Just define a macro(X,Y) that places a sphere and invoke 
it several times.

Felix Wiemann
-- 
light_source{0#macro L(N,S,J)sphere{S.5}sphere{N.5}sphere{J.5}cylinder{
S,N.5}cylinder{S,J.5}#end 3}union{L(0v*-2<2,-2>)L(y*-3z-v*5z*3-y)L(-y*3
0u*3)L(y*-3v*-5-z,z*-3-y)rotate-v*clock pigment{rgb.5}translate<0,2,9>}
// +KFF200 +KF720 +W120 +H90 -F -A -GA -P


Post a reply to this message

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