POV-Ray : Newsgroups : povray.newusers : how to do simple uv mapping? : Re: how to do simple uv mapping? Server Time
4 Nov 2024 21:23:41 EST (-0500)
  Re: how to do simple uv mapping?  
From: Trevor Quayle
Date: 20 Sep 2001 16:49:03
Message: <3baa563f$1@news.povray.org>
3.5 does have uv mapping for boxes now.  The downfall of it is how the
texture is applied.  For perfect cubes, it works fine but for anything else
it the results are not what you would expect (or maybe they are what you
should expect though).  Look at section "6.7.7  UV Mapping".  For boxes, the
texture used is divided into 6 squares as indicated.  Anything lyingoutside
the limits of these squares is not used in the texture mapping. Note that
each square is 1x1 units.
 The face on the -x side uses the texture located in the square
<-1,0>-<0,1>, -z= <0,0>-<1,1>, +x=<1,0>-<2,1>,
+z=<2,0>-<3,1>, -y=<0,-1>-<1,0>, +y=<0,1>-<1,2>.
The problem is each of these squares is stretched to fit the corresponding
face of your cube, therefore if you have a box that is <0,0,0> to <2,1,1>,
the textures on the +/-z faces will be stretched, the aspect ratio is not
maintained. So if you have text wrapping around the box in this case, on the
x faces it will look fine but the z faces will look wunky.  Same with any
other type of texture or pigment.  Some places you may be able to get away
with it, but in textures that you want to keep the aspect ratio, it doesn't
work and I can't seem to find anything that tells me how to control it
otherwise (uv_vectors can only be used in bicubic patches and meshes).
If I am wrong here, someone else may correct me (I'd like to know myself).
Therefore the only real option in this case is to revert to using meshes,
even for boxes.
That's all for now, maybe later I (or someone else can brush over meshes and
uv mapping)

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