POV-Ray : Newsgroups : povray.newusers : Newbie - dont understand texture and position Server Time
24 Nov 2024 23:36:38 EST (-0500)
  Newbie - dont understand texture and position (Message 1 to 3 of 3)  
From: TheMightyZog
Subject: Newbie - dont understand texture and position
Date: 1 Jun 2007 05:25:01
Message: <web.465fe4e11928f4cbff6e04e90@news.povray.org>
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

Source>>>>>>>>>>>
#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}
     }
    }

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}
}
box { // RightWall
  <.8134, 0, -.067>, <1.2134, 1.675, .067>
  material { BrickWall}
}


Post a reply to this message

From: Warp
Subject: Re: Newbie - dont understand texture and position
Date: 1 Jun 2007 08:20:17
Message: <46600f01@news.povray.org>
TheMightyZog <Chr### [at] hotpopcom> wrote:
> 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.

  Procedural textures are spatial 3D textures. You can think about the
texture as filling the entire space with some pattern, and an object
using that texture "cutting" a portion of that 3D texture. Thus what
you see on the surface of the object is a "slice" of the 3D texture at
that location in space.

  You can transform the texture with the object, though. For example, if
you translate the object, you can translate the texture by the same amount
as well, and thus it will look like the texture is attached to the object.
Same goes for rotations and scales.

  Usually you don't need to duplicate all translations made to an object,
though. If you specify the transformations of the object *after* having
specified its texture, the transformations will also be applied to the
texture as well. In other words, you can do this:

object
{ MyObject
  texture { whatever }
  scale 5 rotate <20, 0, 0> translate x*5 // or whatever
}

  Here both MyObject and the texture will be transformed in the same way
and thus it will look like the texture is "attached" to the object.

  If you want to duplicate an object and want all the copies to look
identical, that's easy to do:

#declare MyObject =
  box
  { <whatever> // or any object you want
    texture { the texture of this object }
  };

object { MyObject rotate y*90 translate x*5 }
object { MyObject translate z*5 }
// etc

-- 
                                                          - Warp


Post a reply to this message

From: Stephen
Subject: Re: Newbie - dont understand texture and position
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.