1:merge/intersection/union/difference组合方式的效果,如下图:

merge和union的不同之处,只有当object是透明状态时才会表现出来,如下图可看出这两者的区别

图片描述

2:difference时,范围要放大一些,不要刚好减掉不需要的部分

下面是两个例子

//bad case  从图中看,该去掉的部分并没有完全去掉,计算机浮点运算的精确度造成的!
difference {
      box { -1, 1 pigment { Red } }
      cylinder { <0,0,1>, <0,0,-1>,0.7 pigment { Green } }
      rotate x*30
    }

图片描述

//good case 
difference {
      box { -1, 1 pigment { Red } }
      cylinder { <0,0,1.1>, <0,0,-1.1>,0.7 pigment { Green } }
      rotate x*30
    }

图片描述

3:object的color_map,调整物体的颜色

  sphere {
    <0, 1, 2>, 2
    texture {
    
      pigment {
        wood
        color_map {
          [0.0 color DarkTan]
          [0.9 color DarkBrown]
          [1.0 color VeryDarkBrown]
        }
        turbulence 0.05
        scale <0.2, 0.3, 1>
      }

      finish { phong 1 }
    }
  }

  sphere {
    <3 1, 0>, 2
    texture {
      pigment {
        wood
        color_map {
          [0.0 color Red]
          [0.5 color Red]
          [0.5 color Blue]
          [1.0 color Blue]
        }
        scale <0.2, 0.3, 1>
      }
      finish { phong 1 }
    }
  }

  sphere {
    <0, 1, 0>, 2
    texture {
      pigment {
        DMFWood4       // pre-defined in textures.inc
        scale 4        // scale by the same amount in all
                       // directions
      }
      finish { Shiny } // pre-defined in finish.inc
    }
  }

  sphere {
    <0, 1, 0>, 2
    texture {
        PinkAlabaster     // pre-defined in textures.inc 这是一个完整的texture宏,直接放在texture里就行了
    }
  }

图片描述


猫哥
305 声望44 粉丝

热衷于研究各类互联网技术,热爱学习,热爱生活!


引用和评论

0 条评论