POV-Ray : Newsgroups : povray.general : scaling problem using uv_mapping image_pattern : Re: scaling problem using uv_mapping image_pattern Server Time
2 Nov 2024 11:26:13 EDT (-0400)
  Re: scaling problem using uv_mapping image_pattern  
From: Eric Medlin
Date: 23 Mar 2004 11:48:29
Message: <eric.medlin-E8CB45.11482823032004@news.povray.org>
In article <406059f2@news.povray.org>,
 "Thorsten Froehlich" <tho### [at] trfde> wrote:

> In article <eric.medlin-8CEC8E.09331923032004@news.povray.org> , Eric Medlin
> <eri### [at] ipapercom>  wrote:
> 
> > My understanding is uv mapping allows you to map vertex coord. to points
> > on a texture.  I have used them before in opengl, povray, and different
> > modeling programs.  A full sample scene is provide below.  By removing
> > the uv_mapping you will see the scale changes.  I don't think it should
> > though because the patterns used for the normal maps are a function of
> > the 3d space they are in and that does not change.
> 
> It does, and for a box it is explained in the manual using a nice image.
> Taking a look at it <http://www.povray.org/documentation/images/boxmap.png>
> clearly shows how a one by one unit is mapped onto the box, and if you
> render your scene with a checker pattern and a 0.1 scale (see scene below),
> you will notice that POV-Ray functions exactly as expected.

The manual and that image show how uv mapping for a box is done.  I 
understand that it should scale the image pattern.  Bu where does it say 
it will scale the normal map that uses that image pattern.  Your example 
seems to prove my point also.  Without uv mapping you get 10x10 squares 
on each side of the box.  That makes perfect since.  Unit box normal 
mapped with checker which is 1 unit scaled by 0.1 to give 10 squares on 
each side of the 1 unit box.  Now uv map the image pattern.  The image 
pattern will be scaled and wrapped around the box like the manual says 
and can be seen in the link you provided.  Now I would think that when a 
ray intersects the cube it would convert the intersection point on the 
cup to uv coords on the image pattern. Then get the value from the image 
pattern and look in the normal_map and find the correct normal to apply.  
It would then get that normal which in this case by sampling the checker 
pattern using the point of intersection on the box.  This point of 
intersection would not change if the image pattern is uv mapped or not.  
Also note if you don't uv map but change the map type to say sphere or 
torus this does not change the normals at all.


Post a reply to this message

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