2012-10-14 48 views
1

我正在试图用缠绕在他们周围的包装纸制作一对非常简单的圣诞礼物。这里是我如何尝试这样做,但图像(wrapping_paper.jpg)只是被映射到框的脸上,然后在Z方向上“挤压”。如何在POV-Ray的包装盒中包装图像?

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和其他一些东西,我不能让它看起来正确。这似乎是一件简单的事情,我不敢相信它很难做到。我只是看错了地方。

回答

1

语法可能是关键。

下面是一个例子教程: 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 
}