POV-Ray : Newsgroups : povray.newusers : parameter help please Server Time
6 Nov 2024 09:27:58 EST (-0500)
  parameter help please (Message 1 to 3 of 3)  
From: Tom Melly
Subject: parameter help please
Date: 7 Apr 1999 12:54:23
Message: <370b7faf.0@news.povray.org>
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
    }
}


Post a reply to this message

From: Ken
Subject: Re: parameter help please
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

From: Tom Melly
Subject: Re: parameter help please
Date: 7 Apr 1999 18:59:26
Message: <370bd53e.0@news.povray.org>
Ken wrote in message <370B8C72.B8F8F562@pacbell.net>...

>.......
>
> 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

>.......

Many thanks.

no, you didn't miss anything except that i'm an idiot. I still don't use
declarations enough - either in intent or quantity. i just didn't think of
having the texture as a separate declaration.

My problem had one extra aspect, but your explanation has given me the
answer to that as well.

The problem was that I wanted to use the same object with the same texture
several times. However, I didn't want to re-declare the whole texture in the
object just to use it at a different scale, which was the only parameter
that changed, and only then in one instance.

However, by having the texture in a separate declaration, the re-setting of
scale becomes a comparatively short piece of extra code. I can presumably
use this in the main object declaration, and then forget about it until I
create the one instance of the object where the scale is different.

glad you're out of the cellar.


Post a reply to this message

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