POV-Ray : Newsgroups : povray.newusers : A perplexity... : A perplexity... Server Time
29 Jul 2024 14:14:39 EDT (-0400)
  A perplexity...  
From: Patrick Hagerty
Date: 30 Oct 2005 13:08:46
Message: <43650D4E.E1E95902@daeoria.org>
I'm playing with gems.  (I "wish" they were the real thing.  Just POV
stuff, though.)

I'm observing some anomolous (to me) behavior.  I'm using a declaration
to define the gem structure.  If I use an "intersection" of box objects,
I get a dirty or noisy material as a result.  If I use an intersection
of planes, I get a very clean crystaline result.  The code and resultant
images are below.

Using planes...

// ----------------------------------------
// ----------------------------------------
#declare xAngle = 45.0;
#declare yAngle = 45.0;
#declare zAngle = 45.0;
#declare xPlane = 1.0;
#declare yPlane = 1.0;
#declare zPlane = 1.0;
// ----------------------------------------
#declare CrystalJewel = intersection
{
   plane { x, xPlane }
   plane {-x, xPlane }

   plane { y, yPlane }
   plane {-y, yPlane }

   plane { z, zPlane }
   plane {-z, zPlane }

   plane { x, xPlane rotate  xAngle*y }
   plane {-x, xPlane rotate  xAngle*y }

   plane { x, xPlane rotate -xAngle*y }
   plane {-x, xPlane rotate -xAngle*y }

   plane { y, yPlane rotate  yAngle*z}
   plane {-y, yPlane rotate  yAngle*z}

   plane { y, yPlane rotate -yAngle*z}
   plane {-y, yPlane rotate -yAngle*z}

   plane { z, zPlane rotate  zAngle*x}
   plane {-z, zPlane rotate  zAngle*x}

   plane { z, zPlane rotate -zAngle*x}
   plane {-z, zPlane rotate -zAngle*x}

   bounded_by {sphere {0, 1.7321}}
   no_shadow
}
// ----------------------------------------

Using boxes...
// ----------------------------------------
// ----------------------------------------
#declare BrilliantJewell = intersection
{
   box { <-1.0, -1.0, -1.0>, <1.0, 1.0, 1.0> }
   box { <-1.0, -1.0, -1.0>, <1.0, 1.0, 1.0> rotate -45*x }
   box { <-1.0, -1.0, -1.0>, <1.0, 1.0, 1.0> rotate  45*x }
   box { <-1.0, -1.0, -1.0>, <1.0, 1.0, 1.0> rotate -45*y }
   box { <-1.0, -1.0, -1.0>, <1.0, 1.0, 1.0> rotate  45*y }
   box { <-1.0, -1.0, -1.0>, <1.0, 1.0, 1.0> rotate -45*z }
   box { <-1.0, -1.0, -1.0>, <1.0, 1.0, 1.0> rotate  45*z }

   bounded_by {sphere {0, 1.7321}}

   #if (clock_on)
      rotate frame_number * (360/final_frame)
   #end

   no_shadow
}
// ----------------------------------------

The texture and interior definitions are identical, I just swap out one
or the other () declarations from above using the below macro...

// ----------------------------------------
// ----------------------------------------
#macro Jewel( t_, i_ )
object
{
   CrystalJewel //Octahedron

   texture { t_ }
   interior { i_ }
}
#end
// ----------------------------------------

The result using boxes...
[Image]

The result using planes...
[Image]

Why cant I get the same result using a box as I can using plane objects?

Thanks for your input.

- Patrick


Post a reply to this message

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