|  |  | Hi all,
I am working on a macro to generate tiled floors (or walls) and stumbled on
a problem I had before. When using superellipsoids I get strange black
strips on certain tiles (in the example you can see them on the centered
tiles).
Does anyone have an idea what causes this and how I can get rid off it?
Here's the code:
camera
{
 location <0, 6, -20>
 look_at  <0, 0, 0>
 right x * image_width / image_height
}
global_settings
{
 ambient_light rgb <1, 1, 1>
}
#declare singleTile =
 difference
 {
  superellipsoid
  {
   <0.2, 0.2>
  }
  box
  {
       <-1.2, -1.6, -1.2> <1.2, 0.8, 1.2>
  }
  translate <0, -0.8, 0>
  scale <0.5, 0.5, 0.5>
 }
sky_sphere
{
 pigment
 {
  gradient y
  color_map
  {
   [0.0 rgb <1, 1, 1>]
   [0.2 rgb <0.8, 0.9, 1.0>]
   [0.5 rgb <0.6, 0.7, 1.0>]
   [0.8 rgb <0.8, 0.9, 1.0>]
   [1.0 rgb <1, 1, 1>]
  }
 }
}
light_source
 {
  0 * x
  color rgb <1,1,1>
  translate <-20, 40, -20>
}
plane
{
 y, 0
 pigment
 {
  rgb 1
 }
}
#macro tiledFloor(tileWidth, tileDepth, tileSpace, xTiles, zTiles,
isCentered)
 #declare zPos = 0;
 #if (isCentered = 1)
  #declare xCenter = ((tileWidth + tileSpace) * xTiles) * -0.5;
  #declare zCenter = ((tileDepth + tileSpace) * zTiles) * -0.5;
 #else
  #declare xCenter = 0;
  #declare zCenter = 0;
 #end
 #while (zPos < (xTiles * (tileDepth + tileSpace)))
  #declare xPos = 0;
  #while (xPos < (xTiles * (tileWidth + tileSpace)))
   object
   {
    singleTile
    pigment
    {
     rgb <0.8, 0.9, 1.0>
    }
    scale <tileWidth, 1, tileDepth>
    translate <xCenter + xPos, 0, zCenter + zPos>
   }
   #declare xPos = xPos + (tileWidth + tileSpace);
  #end
  #declare zPos = zPos + (tileDepth + tileSpace);
 #end
#end
tiledFloor(12, 12 , (3/8), 10, 10, 1)
Have a fine day, nUMBc
------------------------------------------------------------------------------
We don't stop playing because we get old; We get old, because we stop
playing!
Post a reply to this message
 Attachments:
 Download 'tiles001.jpg' (112 KB)
 
 
 Preview of image 'tiles001.jpg'
  
 |  |