POV-Ray : Newsgroups : povray.newusers : Trying to understand repetition in agate as a normal : Re: Trying to understand repetition in agate as a normal Server Time
1 Jul 2024 00:10:21 EDT (-0400)
  Re: Trying to understand repetition in agate as a normal  
From: Roman Reiner
Date: 9 Jun 2011 03:30:00
Message: <web.4df075ba5f511c4e1cbe2a350@news.povray.org>
I haven't looked at your source but i assume you apply the agate pattern
*before* translating the objects to their respective position. That way, the
pattern 'moves with the object' resulting in some cubes sampling the same piece
of the agate function along their surface. An example:

box {
  <0,0,0>, <1,1,1>
  normal { agate }
  translate Position1
}

box {
  <0,0,0>, <1,1,1>
  normal { agate }
  translate Position2
}

will result in both boxes sharing the same surface normals as they are created
in the same spot (thus sampling the same region of the agate function) and
*then* moved to their position.

It might work the way you intended by switching the normal with the translate
statement (not sure). If it does not, translating the normal by some offset
vector will work:

#declare S = seed(0);

#declare normalOffset = 100*<rand(S), rand(S), rand(S)>;

box {
  <0,0,0>, <1,1,1>
  normal { agate translate normalOffset}
  translate Position1
}

#declare normalOffset = 100*<rand(S), rand(S), rand(S)>;

box {
  <0,0,0>, <1,1,1>
  normal { agate translate normalOffset}
  translate Position2
}

Regards Roman



"Frank Buchanan" <nomail@nomail> wrote:
> Howdy,
>
> I have been using povray for several years but never really learned it so I
> probably qualify as a "new user".
>
> I am drawing solutions to 3D packing puzzles, like this one:
>     http://www.bumblebeagle.org/polycubes/rt/pentacubes_5x5x5/index.html
> (if you click "next" it adds the next piece to the drawing).  Most of what I
> have done has been by piecing together examples that I found online.
>
> I am now trying to make my puzzle pieces look more interesting and I found an
> example using agate as a surface normal.  I put together an experiment using
> this, of which you can see a two-piece drawing here:
>     http://www.bumblebeagle.org/blarf/povray/N1_1_2.html
> My problem is that two pairs of cube surfaces are identical (other than color).
> These are faces that face the viewer's right shoulder-- the two rightmost ones
> on the top row and the two leftmost ones on the bottom row.  These two pairs
> seem to have the same "texture" pattern ("texture" in quotes because I don't
> meant the povray texture keyword).  Hopefully other people see this the way I am
> seeing it.
>
> Following the example that I found long ago at
>     http://en.wikipedia.org/wiki/File:AGK-pentacube.png,
> and modifying it based on some other examples I found, my pieces are declared
> like this:
>
>   union
>      {
>      ... a single cube object
>      ... another single cube object
>      ... etc.
>
>      texture
>          {
>          pigment { rgb c }
>          finish  { specular 0.6 }
>          normal  { agate 0.35 scale 1.3 }
>          }
>      }
>
> First, I have not been able to find a description of what modifiers I can use
> for normal that would apply to agate.  I have been to these two pages
>     www.povray.org/documentation/view/3.6.1/363/#l157
>     www.povray.org/documentation/view/3.6.1/339/
> but I am not finding what I need.
>
> Second, I understand the concept of the agate pattern being a function in 3-D
> space.  And that it samples that function along the surface of my pieces and
> uses that as the normal (which I assume has to do with the angle of reflection).
>  It appears that that function repeats for the two planar segments that I
> mention above.  I thought that changing the scale value might correct for that--
> my hope was that "scale" would expand or contract the agate function in 3-space
> and since my cubes have unit size then using a non-integer size would correct
> the problem (am I making sense?).  Anyway, it doesn't.  And I haven't been able
> to find a description of what exactly "scale" does.  Or a list of other
> modifiers that would apply for agate.
>
> Anyway, thanks for any help,
> Frank B
>
> P.S. my full source for this can be found at
>     http://www.bumblebeagle.org/blarf/povray/N1_1_.ini
>     http://www.bumblebeagle.org/blarf/povray/N1_1_.pov
> and my command line is
>     povray N1_1_.ini width=320 height=240


Post a reply to this message

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