如何在POV-Ray中将图片包裹在一个盒子周围?

3
我正在尝试构建一个非常简单的场景,其中有几个用包装纸包裹起来的圣诞礼物。以下是我的做法,但图像(wrapping_paper.jpg)只被映射到盒子表面,然后在Z方向上“挤出”。
box { <0,0,0>, <1,1,1>
  texture {
    pigment { 
      image_map {
        jpeg "wrapping_paper.jpg" 
        once
      }
    }
  }
 rotate <-30,40,-7>
 translate <-0.5, -0.5, -0.5>
}

我尝试了不同的地图类型设置、UV映射和其他几个方法,但仍然无法使其看起来正确。这似乎是一个非常简单的事情,我无法相信它很难做到。可能是我找错了地方。

1个回答

3

语法可能是关键。

以下是一个示例教程: http://www.f-lohmueller.de/pov_tut/backgrnd/p_sky9.htm

这里是一些从该教程中提取并修改的代码,我刚刚用自己的png测试过。以动画方式运行以验证它是否按照您的要求执行:

box{ <-1, -1, -1>,< 1, 1, 1>
 texture{ uv_mapping
 pigment{
 image_map{ png "your_very_own.png"
            map_type 0    // planar
            interpolate 2 // bilinear
            once //
          } //  end of image_map
} // end of pigment
finish { ambient 1 diffuse 0 }
 } // end of texture
scale 10.00  
rotate clock*(50*z+120*y)
translate 100*z
} 

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接