POV-Ray : Newsgroups : povray.newusers : Trying to understand repetition in agate as a normal Server Time
22 Dec 2024 21:50:51 EST (-0500)
  Trying to understand repetition in agate as a normal (Message 1 to 8 of 8)  
From: Frank Buchanan
Subject: Trying to understand repetition in agate as a normal
Date: 8 Jun 2011 19:40:00
Message: <web.4df00732e8f89ca12dc642590@news.povray.org>
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

From: Roman Reiner
Subject: Re: Trying to understand repetition in agate as a normal
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

From: Frank Buchanan
Subject: Re: Trying to understand repetition in agate as a normal
Date: 9 Jun 2011 06:20:00
Message: <web.4df09d405f511c4e2dc642590@news.povray.org>
"Roman Reiner" <lim### [at] gmxde> wrote:
> I haven't looked at your source but i assume you apply the agate pattern
> *before* translating the objects to their respective position.

Ah, yes.  That makes sense.

> It might work the way you intended by switching the normal with the translate
> statement (not sure).

That will require some slight restructuring of my code, since the piece's
position is separate from the definition of the piece's object.  But I will
explore that.

> If it does not, translating the normal by some offset vector will work:

That does work.  Thanks!

Frank B


Post a reply to this message

From: Frank Buchanan
Subject: Re: Trying to understand repetition in agate as a normal
Date: 9 Jun 2011 06:25:01
Message: <web.4df09f685f511c4e2dc642590@news.povray.org>
"Frank Buchanan" <nomail@nomail> wrote:
> "Roman Reiner" <lim### [at] gmxde> wrote:
> > It might work the way you intended by switching the normal with the translate
> > statement (not sure).
>
> That will require some slight restructuring of my code, since the piece's
> position is separate from the definition of the piece's object.  But I will
> explore that.

I've now tried that too, and it works.  Thanks again.

Frank B


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Trying to understand repetition in agate as a normal
Date: 9 Jun 2011 13:19:46
Message: <4df100b2$1@news.povray.org>
> I am now trying to make my puzzle pieces look more interesting

But don't overdo it, actually I like the smooth
geometric cleanness of the original version for this
sort of thing ;) Another approach to make them look more
interesting would be to play with transparency and filter
in the pigment, reflection in the finish, and ior in the
interior, to make them look more like colored glass. To
make the reflection look interesting enough you may
need to give them some environment to reflect. And
it may be slow with so many interacting objects.


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Trying to understand repetition in agate as a normal
Date: 9 Jun 2011 13:56:35
Message: <4df10953@news.povray.org>
Couldn't resist (translate: procrastinate more important stuff) ;)

http://news.povray.org/povray.binaries.images/thread/%3C4df108a1%40news.povray.org%3E/

The reflecting version renders reasonably fast and
replaces your normal and finish with

normal  { bozo scale 0.001 }
finish  { specular 0.6 reflection 0.3 conserve_energy }

(note that micronormals + aliasing are not the optimal way
to do blurry reflection, just the shortest to type)

The transparent version is quite slow and uses

texture
{
    pigment { rgbf c + <0,0,0,1> }
    finish  { specular 0.6 reflection 0.1 }			
}
interior {ior 1.5}

replacing your cubie with

#include "shapes.inc"
#declare cubie = Round_Box_Merge(<0,0,0>, <1,1,1>, r)

to get rid of internal surfaces, and increasing the
spacing by a factor of 1.01 to get rid of coincident
surfaces.


Post a reply to this message

From: Frank Buchanan
Subject: Re: Trying to understand repetition in agate as a normal
Date: 9 Jun 2011 17:55:00
Message: <web.4df1403e5f511c4e2dc642590@news.povray.org>
Christian Froeschlin <chr### [at] chrfrde> wrote:
> > I am now trying to make my puzzle pieces look more interesting
>
> But don't overdo it, actually I like the smooth geometric cleanness of the original
version for this
> sort of thing ;)

Agreed, it is possible to overdo it.  More isn't necessarily better.

> Another approach to make them look more interesting would be to play with
> transparency and filter in the pigment, reflection in the finish, and ior in the
> interior, to make them look more like colored glass. To make the reflection
> look interesting enough you may need to give them some environment to
> reflect. And it may be slow with so many interacting objects.

I'm not too worried about render time.  I had thought about transparency and
was/am planning to experiment with that.  Keeping in mind that the main goal is
to describe the puzzle solution, it's not clear to me (pun intended) whether
transparency would make it easier to see the pieces behind front ones, or if it
will just make it more difficult to see where the front piece ends and the
others begin.

Thanks for the thoughts,
Frank B


Post a reply to this message

From: Frank Buchanan
Subject: Re: Trying to understand repetition in agate as a normal
Date: 9 Jun 2011 18:00:00
Message: <web.4df142095f511c4e2dc642590@news.povray.org>
Christian Froeschlin <chr### [at] chrfrde> wrote:
> Couldn't resist (translate: procrastinate more important stuff) ;)
>
>
http://news.povray.org/povray.binaries.images/thread/%3C4df108a1%40news.povray.org%3E/

Thanks.  I will take a look at those and study how you accomplish that.  Both
look nice.

My immediate goal is to change the definition of the pieces so the edges between
adjacent cubies are less rounded.  The current definition is the union of
rounded cubes.  But when adjacent cubes are in the same piece the boundary
between them should instead look like a shallow ditch was routed in the surface.
 Also, when three cubes form an L or elbow the interior angle should just be
flat.  The idea being that then these will look more like pieces that were
milled from some solid substance, instead of being a bunch of cubes glued
together.

Thanks again,
Frank B


Post a reply to this message

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