POV-Ray : Newsgroups : povray.general : Collective Short Code Wisdom : Re: Collective Short Code Wisdom Server Time
31 Jul 2024 08:28:42 EDT (-0400)
  Re: Collective Short Code Wisdom  
From: Alain
Date: 7 Dec 2007 16:12:23
Message: <4759b737@news.povray.org>
Jan Dvorak nous apporta ses lumieres en ce 2007/12/07 14:50:
> 
>> sphere{0 1 pigment{color rgb 0.2} translate<1,2,3>}
>> sphere {1 1 pigment{color rgb 0.4} translate<1,2,3>}
>> sphere {2 1 pigment{color rgb 0.6} translate<1,2,3>}
>>
>> becomes
>>
>> #macro M(c)pigment{color rgb c}translate<1,2,3>#end
>> sphere{0 1 M(.2)}
>> sphere{1 1 M(.4)}
>> sphere{2 1 M(.6)}
>>
>> ;-)
>> Paolo
>>
>>
> yet better
> 
> #macro  M(l,r,c)sphere{l r pigment{color rgb c}translate<1,2,3>}#end
> 
> this saves you two spheres :-)
#macro M(l,r,c,X,Y,Z)sphere{l r pigment{rgb c}translate<X,Y,Z>}#end

Now, you can have different translations for each instances.

-- 
Alain
-------------------------------------------------
Hinduism: This shit has happened before.


Post a reply to this message

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