POV-Ray : Newsgroups : povray.newusers : Newbie - dont understand texture and position : Re: Newbie - dont understand texture and position Server Time
29 Jul 2024 00:23:32 EDT (-0400)
  Re: Newbie - dont understand texture and position  
From: Stephen
Date: 1 Jun 2007 08:45:01
Message: <web.46601453165ebea0c4e49fa40@news.povray.org>
"TheMightyZog" <Chr### [at] HotPOPcom> wrote:
> Hi,
>
> I'm a real newbie (2 days old) and I do not understand why a texture is
> different depending on the position of the object.
>
> I wrote the following and would like to know what I should do to get both
> walls to look the same (as I have failed with all the variations I can
> think of).
>
> Thanks
>
Hi TheMightyZog, welcome.
The way I look at it is. If you define a material it occupies the ether and
only shows up when objects intersect it. It is good PovRay practice to
create objects at the origin and translate them to where you want them.
That way they use the same part of the material. If you do this with your
scene as I did below you will see that you get the desired results. Another
way of doing it would be to put a translate statement in the Material block.
But then you would have to work out the translations yourself.

#declare BrickWall =
   material  // BrickWall
   {
     texture{
        pigment{ brick
                 color <1.000,1.000,1.000>    color rgb <0.815686, 0.490196,
0.05098>
                 brick_size <0.08, 0.0225, 0.0225 >
                 mortar 0.01
               }
        normal { wrinkles 0.75 scale 0.01}
        finish { diffuse 0.9 phong 0.2}
   scale 2
    }

    }

background { color <0.000,0.000,0.000> }

light_source {
  <0, 1.6, -3>
  color rgb <1.000, 1.000, 1.000>*0.7
  adaptive 1
  jitter
  media_attenuation on
  photons {
    reflection on
    refraction on
  }
}

#declare Camera_0 = camera {
    angle 13  // front view
    location  <0.0 , 1.1 ,-10.0>
    right     x*image_width/image_height
    look_at   <0.0 , 0.7 , 10.0>}

camera{Camera_0}

// try .1 = 1 ft  ********************

box { // LeftWall
  <-1.2134, 0, -.067>, <-.8134, 1.675, .067>
  material { BrickWall }

  translate 0.5 *x     // translated to new position
}

box { // RightWall  coppied from  LeftWall
  <-1.2134, 0, -.067>, <-.8134, 1.675, .067>
  material { BrickWall }

  translate 1.5*x             // translated to new position
}




Stephen


Post a reply to this message

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