Domanda

I am trying to build a very simple scene of a couple of Christmas presents with wrapping paper wrapped around them. Here is how I'm trying to do this but the image (wrapping_paper.jpg) just gets mapped onto the box face and then "extruded" in the Z direction.

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>
}

I've tried different map_type settings, uv_mapping, and several other things and I can't make it look correct. This seems like such a simple thing I can't believe that its difficult to do. I am just looking in the wrong place.

È stato utile?

Soluzione

Syntax could be key.

Here's an example tutorial: http://www.f-lohmueller.de/pov_tut/backgrnd/p_sky9.htm

and here's some code lifted and modified from that tute which I just tested out with my own png. Run as animation to verify it's doing what you want:

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
} 
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top