POV-Ray : Newsgroups : povray.unofficial.patches : Transforming an object without transforming its texture : Re: Transforming an object without transforming its texture Server Time
2 Sep 2024 14:13:20 EDT (-0400)
  Re: Transforming an object without transforming its texture  
From: Thomas Willhalm
Date: 18 Apr 2000 10:24:35
Message: <qqmaeircwrg.fsf@schlatt.fmi.uni-konstanz.de>
Chris Huff <chr### [at] yahoocom> writes:

> In article <38ce5f44@news.povray.org>, "Philippe Debar" 
> <phi### [at] hotmailcom> wrote:
> 
> > A workaround : make your object a macro like #macro
> > myObject(currentTransform).
> > 
> > I hope this helps,
> 
> Yes, that is possible, and I often do my objects this way so I can 
> incorporate other randomized elements for a little more realism. But a 
> way to translate an object and not it's texture, some kind of flag for 
> the transform {} blocks, would still be useful sometimes. It would 
> require you to use the transform {} block to enclose your 
> transformations, but this might be a good idea anyway...and it would 
> only be for a few small cases that you would want to do this.

IMHO it would be more "clean" to introduce a way to invert a transformation.
As far as I know, the inverse matrix is already calculated internally.
(The struct TRANSFORM has the two members "matrix" and "inverse".) 
So, the implementation should be easy.

Then you would get the desired effect like this:

#declare Trans = transform { translate .. rotate .... }
#declare InvTrans = transform { invert_transform Trans }
object { ... texture { ... transform{InvTrans} } transform {Trans} }

Just my 0.02 Euro
Thomas

-- 
http://thomas.willhalm.de/ (includes pgp key)


Post a reply to this message

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