In article <37D02258.CCBCEFD7@pacbell.net>, Ken <tyl### [at] pacbellnet> wrote:
>What are bitwise operations and why would someone use them in povray ?
One of the (many) useful things to do with bitwise operations is parameter
passing.
#declare Frogs=1;
#declare Possum=2;
#declare Herps=4;
#declare Elves=8;
#macro trueSwamp(animals)
#if (animals bitand Frogs)
#add frogs
#end
#if (animals bitand Possum)
#add possum
#end
#if (animals bitand Herps)
#add herps
#end
#if (animals bitand Elves)
#add elves
#end
#end
//make a swamp with frogs and Elves
trueSwamp(Frogs + Elves)
Jerry
http://www.hoboes.com/jerry/
Post a reply to this message
|