POV-Ray : Newsgroups : povray.unofficial.patches : Transforming an object without transforming its texture Server Time
2 Sep 2024 10:13:49 EDT (-0400)
  Transforming an object without transforming its texture (Message 1 to 10 of 18)  
Goto Latest 10 Messages Next 8 Messages >>>
From: Nieminen Juha
Subject: Transforming an object without transforming its texture
Date: 12 Mar 2000 09:09:36
Message: <38cba51f@news.povray.org>
How hard would it be to make a patch which would allow transformating an
object without transforming its texture (like the transformation were before
the texture declaration)?
  Sometimes you have something like this:

#declare MyObject = (complete object declaration here)

...

object { MyObject translate whatever }

  Usually you want the texture to be translated with the object, but there
may be some situations where you don't want the texture to be transformed
with the object.
  Usually there's no easy solution to this. One way would be making MyObject
to be a macro with one parameter: The location of the object before applying
texture to it. This, however, is not always a good solution. The object may
be in an include file which you would have to modify. And if the object is
a mesh, you will loose the property of cheap mesh copies.

  Or is this already possible?

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Ken
Subject: Re: Transforming an object without transforming its texture
Date: 12 Mar 2000 09:20:29
Message: <38CBA6DA.C5C087D0@pacbell.net>
Nieminen Juha wrote:
> 
>   How hard would it be to make a patch which would allow transformating an
> object without transforming its texture (like the transformation were before
> the texture declaration)?
>   Sometimes you have something like this:
> 
> #declare MyObject = (complete object declaration here)
> 
> ...
> 
> object { MyObject translate whatever }
> 
>   Usually you want the texture to be translated with the object, but there
> may be some situations where you don't want the texture to be transformed
> with the object.
 
>   Or is this already possible?

I'm not sure I understand the problem. Instead of texturing MyObject
inside the object declaration add the texture when you use the object -

#declare MyObject = (object only declaration here)

...

object { MyObject translate whatever - add texture }

The above will result in the texture centered at the origin while the
object can be anywhere in your scene.

-- 
Ken Tyler -  1300+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Chris Huff
Subject: Re: Transforming an object without transforming its texture
Date: 12 Mar 2000 09:37:46
Message: <chrishuff_99-649021.09393612032000@news.povray.org>
In article <38CBA6DA.C5C087D0@pacbell.net>, lin### [at] povrayorg 
wrote:

> I'm not sure I understand the problem. Instead of texturing MyObject
> inside the object declaration add the texture when you use the object -
> 
> #declare MyObject = (object only declaration here)
> 
> ...
> 
> object { MyObject translate whatever - add texture }
> 
> The above will result in the texture centered at the origin while the
> object can be anywhere in your scene.

And what would you do if the object consists of a complex CSG with many 
textures?


This sounds similar to the reset_children warp, maybe there could be a 
flag in the transform {...} block, like this:

object {MyObject
    transform {
        transform_textures off
        translate ...
    }
}

This would allow you to transform the object and the texture 
separately(by using multiple transform {...} blocks), maybe with the 
addition of a transform_object flag.

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Ken
Subject: Re: Transforming an object without transforming its texture
Date: 12 Mar 2000 09:43:23
Message: <38CBAC35.3042EFC@pacbell.net>
Chris Huff wrote:

> And what would you do if the object consists of a complex CSG with many
> textures?

#declare MyObject =
 union {
  object { Ob1 texture{ stuff translate x*20}}
  object { Ob2 texture{ stuff translate x*20}}
  object { Ob3 texture{ stuff translate x*20}}
  object { Ob4 texture{ stuff translate x*20}}
       }

object { MyObject translate x*-20}

Any questions ?

-- 
Ken Tyler -  1300+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Nieminen Juha
Subject: Re: Transforming an object without transforming its texture
Date: 12 Mar 2000 09:52:23
Message: <38cbaf26@news.povray.org>
Ken <tyl### [at] pacbellnet> wrote:
: #declare MyObject =
:  union {
:   object { Ob1 texture{ stuff translate x*20}}
:   object { Ob2 texture{ stuff translate x*20}}
:   object { Ob3 texture{ stuff translate x*20}}
:   object { Ob4 texture{ stuff translate x*20}}
:        }

: object { MyObject translate x*-20}

: Any questions ?

  Now I want to scale and rotate it as well...

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Nieminen Juha
Subject: Re: Transforming an object without transforming its texture
Date: 12 Mar 2000 09:55:10
Message: <38cbafce@news.povray.org>
Anyways, what I meant was that there would be a way to transform the object
(without transforming the textures) without touching the object code.
  The object may be a 1Meg file with 1000 textures in it.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Chris Huff
Subject: Re: Transforming an object without transforming its texture
Date: 12 Mar 2000 10:28:59
Message: <chrishuff_99-164156.10305012032000@news.povray.org>
In article <38C### [at] pacbellnet>, lin### [at] povrayorg wrote:

> #declare MyObject =
>  union {
>   object { Ob1 texture{ stuff translate x*20}}
>   object { Ob2 texture{ stuff translate x*20}}
>   object { Ob3 texture{ stuff translate x*20}}
>   object { Ob4 texture{ stuff translate x*20}}
>        }
> 
> object { MyObject translate x*-20}
> 
> Any questions ?

Yes, I want to make many(Like 100 or so) different versions of it, each 
scaled, rotated, and with a matrix transform in addition to being 
translated. Can you do that too? :-)

BTW, did I mention that the object is a *complex* CSG with 50 textures, 
not just a simple union? And that it is in a program-generated include 
file that isn't well formatted for reading and editing?

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Ken
Subject: Re: Transforming an object without transforming its texture
Date: 12 Mar 2000 10:38:26
Message: <38CBB90F.7C4AC93F@pacbell.net>
Chris Huff wrote:

> > Any questions ?
> 
> Yes, I want to make many(Like 100 or so) different versions of it, each
> scaled, rotated, and with a matrix transform in addition to being
> translated. Can you do that too? :-)
> 
> BTW, did I mention that the object is a *complex* CSG with 50 textures,
> not just a simple union? And that it is in a program-generated include
> file that isn't well formatted for reading and editing?

Name one scenario where you would need to do this with an object of
this complexity.

-- 
Ken Tyler -  1300+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Chris Huff
Subject: Re: Transforming an object without transforming its texture
Date: 12 Mar 2000 10:58:04
Message: <chrishuff_99-7428D4.10595412032000@news.povray.org>
In article <38CBB90F.7C4AC93F@pacbell.net>, lin### [at] povrayorg 
wrote:

> Name one scenario where you would need to do this with an object of
> this complexity.

A forest of trees and/or other plants. A fleet of space ships. A flock 
of birds or a school of fish. A garden scene.
Oh, you said *one* scenario. Sorry. :-)

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Ken
Subject: Re: Transforming an object without transforming its texture
Date: 12 Mar 2000 11:12:06
Message: <38CBC0EF.C3BD1DA5@pacbell.net>
Chris Huff wrote:
> 
> In article <38CBB90F.7C4AC93F@pacbell.net>, lin### [at] povrayorg
> wrote:
> 
> > Name one scenario where you would need to do this with an object of
> > this complexity.
> 
> A forest of trees and/or other plants. A fleet of space ships. A flock
> of birds or a school of fish. A garden scene.
> Oh, you said *one* scenario. Sorry. :-)

Now correct me if I am wrong here but Warp wants the texture to NOT
translate along with the object. Now if I were to make a complex
tropical fish with multiple textures I can tell you right now I
would want my textures to stay where I put them. If you don't you
will have textures lining up in all the wrong places. With trees
you might have leaf textures where bark is supposed to be and with
a fleet of space ships you might have glass where the hull texture
is supposed to be. I don't understand your examples at all.

-- 
Ken Tyler -  1300+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

Goto Latest 10 Messages Next 8 Messages >>>

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