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:27:39 EDT (-0400)
  Re: scaling problem using uv_mapping image_pattern  
From: Thorsten Froehlich
Date: 23 Mar 2004 10:38:26
Message: <406059f2@news.povray.org>
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.

> I didn't have any reason to use a jpeg.  I just used it.
> Why is it a bad choice?  Compress artifacts?  Anyway here is a sample
> scene that shows my problem.

Yes, if you want a map with precise borders (it appears you want that
because you only have two different types of patterns), then artifacts at
those borders could get into your way.  I would use a grayscale PNG for
this.

    Thorsten



light_source
{
   <5, 5, -5>, rgb <1, 1, 1>
}

camera
{
   perspective
   location <1, 0, -1>
   sky <0, 1, 0>
   direction <0, 0, 1>
   right <1.3333, 0, 0>
   up <0, 1, 0>
   look_at <0, 0, 0>
}

box
{
   <-0.5, -0.5, -0.5>, <0.5, 0.5, 0.5>

   texture
   {
      normal
      {
         uv_mapping image_pattern{tga "mask.tga"}
         //image_pattern{tga "mask.tga"}

         normal_map { [ 0.5 checker ] }
         scale 0.1
     }

      pigment
      {
         color rgb <1, 1, 1>
      }
   }
   scale 1
   rotate <0, 0, 0>
   translate <0, 0.5, 0.5>
}

box
{
   <-0.5, -0.5, -0.5>, <0.5, 0.5, 0.5>

   texture
   {
      normal
      {
         checker
         scale 0.1
      }

      pigment
      {
         color rgb <1, 1, 1>
      }
   }
   scale 1
   rotate <0, 0, 0>
   translate <0, -0.5, 0.5>
}


Post a reply to this message

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