POV-Ray : Newsgroups : povray.newusers : Newbie - dont understand texture and position : Re: Newbie - dont understand texture and position Server Time
29 Jul 2024 00:28:05 EDT (-0400)
  Re: Newbie - dont understand texture and position  
From: Warp
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

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