[pov-ray]merge/intersection/union/difference组合方式的效果[图片]

本文介绍了使用图形渲染软件时的几种基本操作,包括不同几何体的组合方式如合并(merge)、交集(intersection)、并集(union)和差集(difference)的效果对比,并通过实例说明了如何避免计算误差;此外还讲解了如何通过color_map来调整物体的颜色,以实现更加丰富的视觉效果。

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里就行了
    }
  }

图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值