POV-Ray : Newsgroups : povray.binaries.images : Demo Image of Lathe Segments Macro : Re: Tags obfuscation is funny Server Time
8 Aug 2024 18:12:54 EDT (-0400)
  Re: Tags obfuscation is funny  
From: Dave Dunn
Date: 24 May 2005 11:05:02
Message: <web.4293416f697bba04ffb80bcc0@news.povray.org>
"B. Gimeno" <no_### [at] yacom> wrote:
> // Before
> /*
> #local D = union { torus {1,.1 clipped_by {plane {-x,0}}} sphere
> {<0,0,1>,.1} sphere {<0,0,-1>,.1} cylinder {<0,0,-1>,<0,0,1>,.1} pigment
> {rgb .8} finish {ambient .5 reflection {.5}} rotate x*-90 translate
> <-.5,.5,5>} object {D} object {D translate <.5,-1,0>} plane {y,-2 pigment
> {checker rgb 1, rgb 0 scale 5} finish {ambient .5}}
> */
> // After obfuscation
> #macro D(P)union{torus{1,.1clipped_by{plane{-x,0}}}sphere{z,.1}sphere
> {-z,.1}cylinder{-z,z,.1}pigment{rgb.8}finish{ambient.5reflection.5}
> rotate x*-90translate P}#end D(<-.5,.5,5>)D(<0,-.5,5>)plane{y,-2pigment
> {checker rgb 1,0scale 5}finish{ambient.5}}
>
> I believe that it could be shorter. Was thinking on a contest about code
> obfuscation, but SDL  is already obfuscated PER SE. :-)

> B Gimeno
> estoeslarealidad

> http://usuarios.lycos.es/game2413
> light_source{0,1}#macro C(r,p)cylinder{x*-2,x*2,.9
> pigment{rgb p}rotate p*90}#end difference{box{-1,1}C
> (z,x)C(x,y)C(z,z)pigment{rgb 2}rotate 45 translate z*4}

Thanks for the tune-up to my signature. From my calculations, it saves 43
characters (excluding spaces), and renders in exactly the same amount of
time.
Now I guess I have to update my profile  :)

#macro D(P)union{torus{1,.1clipped_by{plane{-x,0}}}sphere{z,.1}sphere
{-z,.1}cylinder{-z,z,.1}pigment{rgb.8}finish{ambient.5reflection.5}
rotate x*-90translate P}#end D(<-.5,.5,5>)D(<0,-.5,5>)plane{y,-2pigment
{checker rgb 1,0scale 5}finish{ambient.5}}


Post a reply to this message

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