POV-Ray : Newsgroups : povray.newusers : reset/strip textures? Server Time
29 Jun 2024 11:07:15 EDT (-0400)
  reset/strip textures? (Message 1 to 5 of 5)  
From: Rafal 'Raf256' Maj
Subject: reset/strip textures?
Date: 9 Jan 2005 00:28:38
Message: <Xns95D941FDFD3F8raf256com@203.29.75.35>
Hi,
if I have an object with already have some texture, how can I discard all 
texture settings from it (strip texture), and apply a new texture to it?

Example:


#declare obj = 
union {
  sphere { -x 1 pigment { rgb x } } // ((B))
  sphere { +x 1 pigment { rgb y } } // ((C))
  sphere { +y 1 }  sphere { -z .1 }
  pigment { rgb .5 }
  scale 100 rotate y*30
  translate y*100
}

object { 
  obj 
  pigment { rgb 1 } // ((A))
}

and I would like the object to be entire white - rgb 1. Currently the line 
((A)) do not change red and green texture in ((B)) and ((C)) 


Rest part of minimal example scene:

plane { y,0 pigment { rgbf .8 } finish { diffuse 0 ambient 1 } no_shadow }
camera { location <100,70,-500>*1.3 look_at y*50 }
light_source { <1000,0,-15000> rgb 1 }
light_source { <1000,1000,-150> rgb 1 }





-- 
http://www.raf256.com/3d/
Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
Computer Graphics


Post a reply to this message

From: Jim Charter
Subject: Re: reset/strip textures?
Date: 9 Jan 2005 01:37:18
Message: <41e0d11e@news.povray.org>
Rafal 'Raf256' Maj wrote:
> Hi,
> if I have an object with already have some texture, how can I discard all 
> texture settings from it (strip texture), and apply a new texture to it?
> 
> Example:
> 
> 
> #declare obj = 
> union {
>   sphere { -x 1 pigment { rgb x } } // ((B))
>   sphere { +x 1 pigment { rgb y } } // ((C))
>   sphere { +y 1 }  sphere { -z .1 }
>   pigment { rgb .5 }
>   scale 100 rotate y*30
>   translate y*100
> }
> 
> object { 
>   obj 
>   pigment { rgb 1 } // ((A))
> }
> 



The most locally applied texture always overrides the more generally 
applied one (not vice versa).  In your example even if you removed the 
pigments to spheres in B and C  the pigment ( rgb .5 ) in the union 
block would still override A in the object block.

But the intention of your question is not clear.  What do you want to do 
exactly, avoid the manual editing in the spheres?  Are you changing the 
texture during an animation?  You could use the clock value to adjust 
the texture or actually wrap the objects in a macro and pass the texture 
that way I suppose.


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: reset/strip textures?
Date: 9 Jan 2005 01:40:10
Message: <Xns95D94E1E8A7A3raf256com@203.29.75.35>
jrc### [at] msncom news:41e0d11e@news.povray.org

> But the intention of your question is not clear.  What do you want to do 
> exactly, avoid the manual editing in the spheres?  Are you changing the 
> texture during an animation?  You could use the clock value to adjust 
> the texture or actually wrap the objects in a macro and pass the texture 
> that way I suppose.
> 

I have a complicated object, for example - imported via Polyray. I have to 
render it with several varsion, in few of them - giving entire object some 
special texture in example pure white. DOing it manualy (changing all 
texture{} into #if(...) texture{} #else pigment{rgb 1} #end) would be very 
uncomfortable.

So there is no ready thing to make that?

I quess it would be possible to write a path, that will walk tree of a 
given object and change every texture?

-- 
http://www.raf256.com/3d/
Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
Computer Graphics


Post a reply to this message

From: Jim Charter
Subject: Re: reset/strip textures?
Date: 9 Jan 2005 10:42:40
Message: <41e150f0$1@news.povray.org>
Rafal 'Raf256' Maj wrote:
> jrc### [at] msncom news:41e0d11e@news.povray.org
> 
> 
>>But the intention of your question is not clear.  What do you want to do 
>>exactly, avoid the manual editing in the spheres?  Are you changing the 
>>texture during an animation?  You could use the clock value to adjust 
>>the texture or actually wrap the objects in a macro and pass the texture 
>>that way I suppose.
>>
> 
> 
> I have a complicated object, for example - imported via Polyray. I have to 
> render it with several varsion, in few of them - giving entire object some 
> special texture in example pure white. DOing it manualy (changing all 
> texture{} into #if(...) texture{} #else pigment{rgb 1} #end) would be very 
> uncomfortable.
> 
> So there is no ready thing to make that?
> 
> I quess it would be possible to write a path, that will walk tree of a 
> given object and change every texture?
> 
can you give the textures names before you import?

then you can assign different colors dynamically

ie

in one place

#declare Name1 = rgb Green;
#declare Name2 = rgb Blue;
#declare Name3 = rgb Cyan;

then in another place

#declare Name1 = rgb White;
#declare Name2 = rgb White;
#declare Name3 = rgb White;

this is only solution I can suggest if you
need the granularity in one place but not
in another.


Post a reply to this message

From: Warp
Subject: Re: reset/strip textures?
Date: 9 Jan 2005 15:12:02
Message: <41e19012@news.povray.org>
Rafal 'Raf256' Maj <spa### [at] raf256com> wrote:
> if I have an object with already have some texture, how can I discard all 
> texture settings from it (strip texture), and apply a new texture to it?

  You can't.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

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