POV-Ray : Newsgroups : povray.text.scene-files : Merge isn't working as expected..any ideas why? Server Time
5 Jul 2024 10:18:39 EDT (-0400)
  Merge isn't working as expected..any ideas why? (Message 1 to 1 of 1)  
From: Eitan Tal
Subject: Merge isn't working as expected..any ideas why?
Date: 22 Jan 2001 15:40:48
Message: <3A6C9A9D.9F493A39@netvision.net.il>
#version 3

#include "colors.inc"
#include "glass.inc"

global_settings
{
  assumed_gamma 1.0
}

// ----------------------------------------
camera
{
  location  <3.0, 0.0, -13.0>
  direction 1.5*z
  right     4/3*x
  look_at   <1.5, 0.0,  0.0>
}

sky_sphere
{
  pigment
  {
    gradient y
    color_map { [0.0 color blue 0.6] [1.0 color rgb 1] }
  }
}

light_source
{
  0*x // light's position (translated below)
  color red 1.0  green 1.0  blue 1.0  // light's color
  translate <-30, 30, 30>
}

//Parameters for Textures
#declare WallTexture = texture {pigment {color rgb <0.8,0.45,0.0>}}
#declare FloorTexture = texture {pigment {checker color rgb 1 color rgb
<0,0,1>}}

//Glasses
#declare G_Background = texture {T_Glass2}
#declare G_Foreground = texture {T_Glass1}
#declare G_Blue = texture { T_Vicksbottle_Glass }

//Parameters for the RawMaterial (fungus)
#declare toph = 4
#declare w1 = 12
#declare h1 = 22
#declare w2 = 21
#declare CheckPoint = 11
#declare h2 = (w2 * CheckPoint) / w1
#declare CenterX = 10.5
#declare CenterY = 17
#declare r = 3
#declare r1 = 2.16

//Parameters for the Room
#declare WallThickness = 3
#declare Size = 13

#declare RawMaterial =
union {
  box
  {
    <(w2-w1)/2,0,0>  // one corner position <X1 Y1 Z1>
    <(w2+w1)/2,h1,1>  // other corner position <X2 Y2 Z2>
  }
  intersection {
    cylinder
    {
      0*z, 1*z, 0.43
      scale <w2,h2,1>
      translate <CenterX, CenterY,0>
    }
    box {<-1,CheckPoint,-1>,<w2+1,CenterY,2>}
  }
  intersection
  {
    cylinder
    {
      0*z, 1*z, 0.43
      scale <w2,h2-3.5,1>
      translate <CenterX, CenterY,0>
    }
    box {<-1,CenterY,-1>,<w2+1,h1,2>}
  }
  intersection
  {
    cylinder
    {
      0*z, 1*z, 0.43
      scale <w2,h2-3.5,1>
      translate <CenterX, CenterY,0>
    }
    box {<-1,CenterY,-1>,<w2+1,h1,2>}
  }
  difference
  {
    box {
      <(w2-w1)/2,h1,0>,
      <(w1+w2)/2,h1+toph,1>
    }
    cylinder {-1*z, 2*z, r
      scale <w2/2, toph, 1>
      translate <((w2-w1)/2)-(r1*w2/2),h1+(r1*toph),0>
    }
    cylinder {-1*z, 2*z, r
      scale <w2/2, toph, 1>
      translate <((w2+w1)/2)+(r1*w2/2),h1+(r1*toph),0>
    }
  }
}

#declare Room =
union {
  difference {
    box {
      <-Size,-Size,-2*Size>,
      <Size,Size,Size>
      texture {WallTexture}
    }
    box {
      <-Size+WallThickness,-Size+WallThickness,(-Size+WallThickness)*2>,

      <Size-WallThickness,Size-WallThickness,Size-WallThickness>
      texture {WallTexture}
    }
  }
  box {
    <-Size+WallThickness,-Size+WallThickness,-Size+WallThickness>,
    <Size-WallThickness,-Size+(2*WallThickness),Size-WallThickness>
    pigment {color rgb 1}
  }
}

//---------------------
// Misc. that will be applyed on RawMaterial
#declare Depth = 0.5

#declare Gem1a = mesh {
  triangle {<0, 1,0>,< 1,0,0>,<0,0,Depth> texture {G_Blue}}
  triangle {<0,-1,0>,< 1,0,0>,<0,0,Depth> texture {G_Foreground}}
  triangle {<0,-1,0>,<-1,0,0>,<0,0,Depth> texture {G_Blue}}
  triangle {<0, 1,0>,<-1,0,0>,<0,0,Depth> texture {G_Foreground}}
}
#declare Gem1b = mesh {
  triangle {<0, 1,0>,< 1,0,0>,<0,0,Depth> texture {G_Foreground}}
  triangle {<0,-1,0>,< 1,0,0>,<0,0,Depth> texture {G_Blue}}
  triangle {<0,-1,0>,<-1,0,0>,<0,0,Depth> texture {G_Foreground}}
  triangle {<0, 1,0>,<-1,0,0>,<0,0,Depth> texture {G_Blue}}
}
#declare BigGem1 = mesh {
  triangle {<0,0,0>,<1,1,0>,<1,1/3,Depth> texture {G_Foreground}}
  triangle {<0,0,0>,<1,1/3,Depth>,<1,-1/3,Depth> texture {G_Blue}}
  triangle {<0,0,0>,<1,-1,0>,<1,-1/3,Depth> texture {G_Foreground}}
  triangle {<1,1,0>,<1,1/3,Depth>,<3,1,0> texture {G_Foreground}}
  triangle {<1,1/3,Depth>,<3,1,0>,<3,1/3,Depth> texture {G_Foreground}}
  triangle {<1,1/3,Depth>,<1,-1/3,Depth>,<3,-1/3,Depth> texture
{G_Blue}}
  triangle {<1,1/3,Depth>,<3,-1/3,Depth>,<3,1/3,Depth> texture {G_Blue}}

  triangle {<1,-1,0>,<1,-1/3,Depth>,<3,-1,0> texture {G_Foreground}}
  triangle {<1,-1/3,Depth>,<3,-1,0>,<3,-1/3,Depth> texture
{G_Foreground}}
  triangle {<4,0,0>,<3,1,0>,<3,1/3,Depth> texture {G_Foreground}}
  triangle {<4,0,0>,<3,1/3,Depth>,<3,-1/3,Depth> texture {G_Blue}}
  triangle {<4,0,0>,<3,-1,0>,<3,-1/3,Depth> texture {G_Foreground}}
}
//---------------------
// WindowGlass. uses RawMaterial and Miscs.

#declare WindowGlass =
union {
  object {RawMaterial texture {G_Background}}
  object {Gem1a translate <10.5,23,0>}
  object {Gem1b translate < 8.5,21,0>}
  object {Gem1b translate <12.5,21,0>}
  object {Gem1a translate <14.5,19,0>}
  object {Gem1a translate < 6.5,19,0>}
  object {Gem1b translate <16.5,17,0>}
  object {Gem1b translate < 4.5,17,0>}
  object {Gem1a translate <14.5,15,0>}
  object {Gem1a translate < 6.5,15,0>}
  object {Gem1b translate < 8.5,13,0>}
  object {Gem1b translate <12.5,13,0>}
  object {Gem1a translate <10.5,11,0>}

  object {BigGem1 translate <10.5,17,0>}
  object {BigGem1 rotate 180*z translate <10.5,17,0>}
  object {BigGem1 rotate 90*z translate <10.5,17,0>}
  object {BigGem1 rotate -90*z translate <10.5,17,0>}
}

//---------------------
// Actual Objects

difference {
  object {Room pigment{color rgb <1,1,1>}}
  object {RawMaterial scale <0.5,0.5,WallThickness*2> translate
<-5.25,-6.0,Size-WallThickness-1> texture {WallTexture}}
}

object {WindowGlass scale <0.5,0.5,0.25> translate <-5.25,-6.0,Size>}

plane
{
  y, -13.0
   pigment {color rgb <0.7,0.5,0.3>}
}


Post a reply to this message

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