POV-Ray : Newsgroups : povray.newusers : parameter help please : Re: parameter help please Server Time
6 Sep 2024 02:19:17 EDT (-0400)
  Re: parameter help please  
From: Ken
Date: 7 Apr 1999 13:54:01
Message: <370B8C72.B8F8F562@pacbell.net>
Tom Melly wrote:
> 
> if i am using a declared object, with a texture in the object declaration,
> how can i just change the scale of the texture when I use the object, but
> retain the rest of the texture settings? If i just add a  scale (as per the
> example below), the old texture is completely replaced, rather than
> appended.
> 
> Also, assuming this is possible, would the scaling over-ride the original
> scale, or would it scale the original scale?
> 
> example:
> 
> #declare  mysphere =
> object{
>     sphere{
>         <0,0,0>, 5
>         texture{
>             bozo
>             scale 0.5
>             color_map{
>                 [0 White]
>                 [1 Black]
>             }
>         }
>     }
> }
> 
> object{
>     mysphere
>     texture{
>         scale 0.25
>     }
> }

There are several approaches to adding textures to an object each with
it's own charachteristics. The most flexible method in from my experience
would be like the example below:

 #declare MyTex =
  texture {
   pigment { bozo
    color_map {
               [0 rgb .5]
               [1 rgb  1]
              }
     scale 0.5
    }
  }

 #declare Obj = sphere { <0,0,0>, 1 }

 object { Obj
  texture { MyTex 
             scale < optional > 
         }
     scale 5.0
  }


   In the above example I originaly made the object 1 pov unit then as
 a final operation scaled it to the size needed to fit the application.
 With the scale following the texture statement the texture will scale
 uniformly with the scale given to the object. This way if you find a
 pattern tht looks good with your object at a scale of one it will look
 exactly the same at a scale of 5 or 10 and even 2000. If adjustment
 is need for the pattern the optional scale for the texture in the
 object statemnt can be used to overide the default set in the texture
 declaration statement. Another advantage to the 1 unit scale is
 that if you need to translate the object later to a different location
 the texture will stay oriented exactly the same as if it were still
 at the origin. If you tried to scale it later after relocating the
 sphere object the effect on the texture would be unpredictable and
 difficult to control.
   Had I choosen to declare the sphere object at a scale of 5 initialy
 as you did I would then have had to scale the texture to 5 to make it
 match the 5 unit scaled sphere and then add or subtract from that to
 adjust it. I find this method less desirable than the one I illustrated.

   I find this gives probably the greatest amount of flexibility with
 the least amount of optional parameters. There are cases where you may
 want to take advantage of the default behaviors pov uses for applying
 textures and pigments to objects but it is on a case by case basis.
 If you follow my suggested usage you should master control of your
 textures in a reasonably short time and then canstart playing with
 non standard methods to enhance your skills and add versitility to
 your texturing abilities.

 If I missed something or you need clarification on something I said
 feel free to bring it up I an I will try to explain it as best I
 can.

 Regards,

-- 
Ken Tyler

mailto://tylereng@pacbell.net


Post a reply to this message

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