POV-Ray : Newsgroups : povray.binaries.images : How to put an image on ONE side of a box : Re: How to put an image on ONE side of a box Server Time
19 Apr 2024 19:56:57 EDT (-0400)
  Re: How to put an image on ONE side of a box  
From: Alain Martel
Date: 20 Feb 2020 15:49:15
Message: <5e4ef0cb$1@news.povray.org>
Le 2020-02-19 à 11:47, Wijnand a écrit :
> Who can help me to put an image on ONE side of a box.
> 
> #declare Tegel_1 =
> box { <100, -9, 100>, <-100, 0, -100>
>    pigment {
>      image_map {
>        gif "vintage-40-vloertegel.gif"
>        map_type 1
>        once
>      }
>      scale 1
>    }
> }
> 
> The image is: vintage-40-vloertegel.gif
> The result is: test_01.png

map_type 1 is used to map the image on a sphere.
You want to use map_type 0, the default.
It maps the image in a tiling fashion along the X-Y plane.

So, it becomes :
#declare Tegel_1 =
box { 0, 1 //from <0,0,0> to <1,1,1>
   pigment {
     image_map {
       gif "vintage-40-vloertegel.gif"//use default mapping
     }
  translate <-0.5, -0.5, 0>//  centre it
  rotate 90*x // flip to the X-Z plane
     scale <200, 9, 200> // scale to the desired dimention
   }
}


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.