POV-Ray : Newsgroups : povray.general : Status of Moray? : Re: New SDL for POVRay Server Time
13 Jul 2025 22:19:04 EDT (-0400)
  Re: New SDL for POVRay  
From: Bruno Cabasson
Date: 5 Oct 2007 19:35:00
Message: <web.4706c94be7dc7428fe8a5e3f0@news.povray.org>
Nicolas Alvarez <nic### [at] gmailisthebestcom> wrote:

> Also, how would you handle this?
> sphere {
>     <1,2,3>, 0.5
>     translate <12,35,61>
>     texture { some_complex_texture }
>     translate y*2
> }
> The first translate doesn't affect the texture, the second does.
>

Just like POV does (correct me if I am wrong): when translate is encountered
it translates the whole object. At the time of first translate, no texture
is specified yet (=null, I suppose). At the time of the second the sphere's
'texture' field is non-null, thus transformed with the object. The final
state is that de texture has been translated twice.

In new SDL, it would be the same: the translate() method (or whatever it
will be) of an object (or its derived) will apply on whatever there is
inside the current object. You could have also written

 sphere {
     <1,2,3>, 0.5
     translate <12,35,61>
     texture { some_complex_texture translate 100*x}
     translate y*2
 }

with 3 translations for the texture.

Bruno


Post a reply to this message

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