【问题标题】:How do you wrap an image around a box in POV-Ray?如何在 POV-Ray 中将图像包裹在盒子周围?
【发布时间】:2012-10-14 18:49:26
【问题描述】:

我正在尝试构建一个非常简单的场景,其中包含一些用包装纸包裹的圣诞礼物。这是我尝试执行此操作的方法,但图像(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>
}

我尝试了不同的 map_type 设置、uv_mapping 和其他一些东西,但我无法让它看起来正确。这似乎是一件如此简单的事情,我不敢相信它很难做到。我只是找错地方了。

【问题讨论】:

    标签: povray


    【解决方案1】:

    语法可能是关键。

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

    这里有一些代码是从我刚刚用我自己的 png 测试出来的那个 tute 中提取和修改的。以动画形式运行以验证它是否在执行您想要的操作:

    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
    } 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-16
      • 1970-01-01
      • 2014-10-03
      • 1970-01-01
      • 2018-09-08
      • 2014-05-23
      相关资源
      最近更新 更多