POV-Ray : Newsgroups : povray.general : Collective Short Code Wisdom Server Time
31 Jul 2024 06:23:16 EDT (-0400)
  Collective Short Code Wisdom (Message 11 to 20 of 20)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Mike the Elder
Subject: Re: Collective Short Code Wisdom
Date: 4 Dec 2007 10:00:00
Message: <web.47556b35e1f3da1ee2b2e7080@news.povray.org>
Since the thread seems to have largely run its course, I should like to conclude
by reiterating thanks all contributors and repeating some very useful references
that were posted in another thread by "dlm"

====== Begin quote from "dlm" ====================
.... short code competition, round 5 is posted at
http://local.wasp.uwa.edu.au/~pbourke/modelling_rendering/scc5/
This year it is a 100 frame animation with a 512 byte max.
Entrants will vote on the 'craft' of the animation.

A Chris Colefax animation primer is available at
http://www.geocities.com/SoHo/Gallery/2006/xani.htm

Reading past entries is quite instructive - TEK has been particularly
generous in sharing his techniques. e.g.
http://local.wasp.uwa.edu.au/~pbourke/modelling_rendering/scc3/final/swokwz_l.pov
http://local.wasp.uwa.edu.au/~pbourke/modelling_rendering/scc4/final/l_nfzrtu.pov
and on this NG.

Also "Tips for Short Code Contest" was posted by Mike Kost in p.g 12 Oct
2006
http://news.povray.org/povray.general/thread/%3C452e87f1%40news.povray.org%3E/?ttop=247562&toff=350
====== End quote from "dlm" ======================

Regards,
Mike C.


Post a reply to this message

From: Paul Bourke
Subject: Re: Collective Short Code Wisdom
Date: 5 Dec 2007 05:30:01
Message: <web.47567c95e1f3da1e65f2686d0@news.povray.org>
> Since no objection from Mr. Bourke (or anyone else) has been forthcoming, I
> shall proceed with my declared intention of opening a thread for tips on
> shortening POV-Ray SDL (Scene Description Language) code.

I don't remember being asked but I certainly have no objection.

Indeed, if you or anyone else would like to contribute to a list of tips then I
will create a document on the scc5 page. I've already had some contributions,
one used some neat scripts to automatically reduce the byte count.

-------------------------------------
P a u l   B o u r k e
http://local.wasp.uwa.edu.au/~pbourke/


Post a reply to this message

From: Paolo Gibellini
Subject: Re: Collective Short Code Wisdom
Date: 7 Dec 2007 06:48:50
Message: <47593322@news.povray.org>
Macro are useful too in order to apply translations or other modifiers to
different objects
e.g.

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


Post a reply to this message

From: Warp
Subject: Re: Collective Short Code Wisdom
Date: 7 Dec 2007 11:43:03
Message: <47597817@news.povray.org>
Paolo Gibellini <p.g### [at] teinoscom> wrote:
> #macro M(c)pigment{color rgb c}translate<1,2,3>#end

  That's at least 6 characters too long.

-- 
                                                          - Warp


Post a reply to this message

From: Mike the Elder
Subject: Re: Collective Short Code Wisdom
Date: 7 Dec 2007 12:10:00
Message: <web.47597e48e1f3da1e53f168bf0@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> Paolo Gibellini <p.g### [at] teinoscom> wrote:
> > #macro M(c)pigment{color rgb c}translate<1,2,3>#end
>
>   That's at least 6 characters too long.
>
> --
>                                                           - Warp

For anyone interested, I'll take the liberty of assuming that Warp meant that
"color " could be omitted.

Regards,
MIke C.


Post a reply to this message

From: Paolo Gibellini
Subject: Re: Collective Short Code Wisdom
Date: 7 Dec 2007 13:07:41
Message: <47598bed@news.povray.org>
"color"!
Thanks,
;-)
Paolo
>"Warp" <war### [at] tagpovrayorg> wrote
> Paolo Gibellini <p.g### [at] teinoscom> wrote:
> > #macro M(c)pigment{color rgb c}translate<1,2,3>#end
>
>   That's at least 6 characters too long.
>
> -- 
>                                                           - Warp


Post a reply to this message

From: Jan Dvorak
Subject: Re: Collective Short Code Wisdom
Date: 7 Dec 2007 14:50:33
Message: <4759a409@news.povray.org>
> 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 :-)


Post a reply to this message

From: Alain
Subject: Re: Collective Short Code Wisdom
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

From: Chris Cason
Subject: Re: Collective Short Code Wisdom
Date: 8 Dec 2007 13:33:26
Message: <475ae376@news.povray.org>
You may want to put some of this on the wiki.

-- Chris


Post a reply to this message

From: Bill Pragnell
Subject: Re: Collective Short Code Wisdom
Date: 8 Dec 2007 16:30:00
Message: <web.475b0bbee1f3da1e1cc2a65e0@news.povray.org>
While we're at it - if you want high-ambient objects like suns or radiosity
emitters, don't use ambient 1 in a finish statement; use a high color value
instead.

e.g. pigment{rgb 1}finish{ambient 1} -> pigment{rgb 9}

This produces very similar results, easily tweakable to one's purposes...

:)


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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