POV-Ray : Newsgroups : povray.binaries.images : UV Mapping : Re: UV Mapping Server Time
12 Aug 2024 19:37:02 EDT (-0400)
  Re: UV Mapping  
From: Christoph Hormann
Date: 17 Jul 2003 04:13:51
Message: <3F165ABE.1B777BA5@gmx.de>
Gena Obukhov wrote:
> 
> I'm trying to make some boats for Capriccio scene.
> I created the boat itself in sPatch but I cannot make
> UV map for it. Here is what I did:
> sPatch->DXF->Crossroads->OBJ->UVMapper->OBJ+UV->Poseray->mesh
> As a result from UVMapper I have the image map
> (see the first image below). So the question is - how
> I can stretch my wood texture (see the second image
> below) onto that uv map? Should I use any warping
> software? I tried WinMorph but it doesn't allow to
> warp one image into another.

Try using functions in POV-Ray.  You would also be able to use procedural
textures instead of an image map then.

I don't really understand why the uv-coordinates are so curved though. 
Wouldn't it be easier for the program to use much simpler coordinates
following the contour of the shape?

When you have the function for the pigment:

#declare fn_Color=
  function {
    pigment {
      ...
    }
  }

And mapping functions for the coordinates;

#declare fn_X=
  function {
    [x coordinate depending on x and y (and possibly z)]
  }

#declare fn_Y=
  function {
    [y coordinate depending on x and y (and possibly z)]
  }

You use a pigment:

#declare PigX=
  pigment {
    function { fn_Color(fn_X(x, y, z), fn_Y(x, y, z), z).red }
    color_map {
      [0 color rgb 0 ]
      [1 color rgb 3*x ]
    }
  }

#declare PigY=
  pigment {
    function { fn_Color(fn_X(x, y, z), fn_Y(x, y, z), z).green }
    color_map {
      [0 color rgb 0 ]
      [1 color rgb 3*y ]
    }
  }

#declare PigZ=
  pigment {
    function { fn_Color(fn_X(x, y, z), fn_Y(x, y, z), z).blue }
    color_map {
      [0 color rgb 0 ]
      [1 color rgb 3*z ]
    }
  }

#declare Pig_Final=
  pigment {
    average
    pigment_map {
      [1 PigX]
      [1 PigY]
      [1 PigZ]
    }
  }

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 17 Jun. 2003 _____./\/^>_*_<^\/\.______


Post a reply to this message

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