POV-Ray : Newsgroups : povray.newusers : how to do simple uv mapping? : Re: how to do simple uv mapping? Server Time
5 Sep 2024 06:14:38 EDT (-0400)
  Re: how to do simple uv mapping?  
From: Trevor Quayle
Date: 20 Sep 2001 17:34:29
Message: <3baa60e5@news.povray.org>
image_maps are positioned from 0,0 to 1,1 no matter what the size of the
original image is and by default, it will repeat itself every 1 unit
interval (unless you specify the "once" option), therefore you should be
getting the same image on every side of the cube. if you add "once" to the
image_map, you will only get it on the -z face of the cube.  What you need
to do her is to scale your image map.

Now remember that the uv map texture runs from -1 to 3 so scale your image
map by <4,1,1> and then translate it <-1,0,0> and add "once" to the
image_map.  The image should wrap around every face of the cube with the y
faces blank.  Now replace the scaling with <4,3,1> and the translate with
<1,-1,0> and see what you get.

The key to what you are doing here is the way image_map works.

> box {
>   <-1, -1, -1>, <1, 1, 1>
>
>     texture {
>         uv_mapping pigment {
>         image_map {
>           sys "Earth3d.bmp"
>           map_type 0
>           interpolate 0
             once  // add to prevent image from repeating
>         }
            scale <4,1,1> translate <-1,0,0> // scale and translate
image_map
>       }
>     }
>   scale 10.0
>   rotate <0,45,45>
> }


-tgq


--
camera{location z*13look_at 0}light_source{15 15looks_like{sphere{0 10
}pigment{rgb 1}finish{ambient 15}}}union{torus{3,0.5rotate x*90}cone{y
*4,.5,-y*8,0}cone{-x*4,.5,x*8,0}pigment{rgb<.7,.6,.4>}finish{ambient 0
diffuse 0reflection{1fresnel on metallic 1}}interior{ior 25}rotate 15}
plane{y,-7pigment{checker rgb 0rgb 1scale 4}finish{diffuse.1}}//   TGQ


Post a reply to this message

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