POV-Ray : Newsgroups : povray.binaries.images : Woven Cloth Texture : Re: Woven Cloth Texture Server Time
31 Jul 2024 14:29:03 EDT (-0400)
  Re: Woven Cloth Texture  
From: Thomas de Groot
Date: 18 Feb 2010 04:27:11
Message: <4b7d07ef$1@news.povray.org>
"Dave Blandston" <nomail@nomail> schreef in bericht 
news:web.4b7bf3a8adaa4c5ecba3fb0f0@news.povray.org...
> Here's a simple computer programming example to show how and why this 
> works:
>
>   x = 1;
>   .
>   .
>   .
>   x = x + 1;
>
> In this case, the variable "x" is assigned a value (1), then later it's 
> assigned
> a new value based on the old value. This works because when the new value 
> is
> assigned, a temporary copy is made of the old value, manipulated (in this 
> case 1
> is added), then re-stored in the original location and becomes "x" again.
> "P_Cloth" is just a more complex variable that can be manipulated like any
> simpler variable. The restriction would be that once "P_Cloth" is defined 
> as a
> pigment it must remain a pigment.
>
> This can be a useful technique to make your scenes more readable, and also 
> more
> efficient by not leaving intermediate variables laying around.

Interesting. I knew this of course for variables, but I had never realized 
that it applied also to more complex pigment codes. I don't think this is 
mentioned in the docs, is it? I always assumed that one needed intermediate 
names to make this work.

Yet learned something new! Hurray!  :-)

Thanks indeed for the explanation, Dave.

Thomas


Post a reply to this message

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