POV-Ray : Newsgroups : povray.unofficial.patches : uv_mapping again - how to? Server Time
1 Nov 2024 05:22:30 EDT (-0400)
  uv_mapping again - how to? (Message 1 to 4 of 4)  
From: Marc-Hendrik Bremer
Subject: uv_mapping again - how to?
Date: 17 Apr 2001 15:43:18
Message: <3adc9cd6@news.povray.org>
Hi,

I give it up. I don't understand how to map an image on a union of
bezier_patches created in Hamapatch.

I exported a simple plane out of 32 patches an tried to map a png on it. The
union lies in the x/z-plane. As the image_map is in the x/y-plane, I rotated
it x*90.

The code I added to the union:

uv_mapping
 texture{pigment{rgb 1}}
 texture{ pigment {
    image_map{
      png "Flagge.png" // the file to read (iff/gif/tga/png/sys)
             map_type 0 // 0=planar, 1=spherical, 2=cylindrical, 5=torus
             interpolate 2 // 0=none, 1=linear, 2=bilinear, 4=normalized
distance
             once
           } // image_map
          rotate x*90          }
        }

What is wrong? I only get stripes of my image, streched in the z-axis.
In addition, if I rotate the object, the texture does not rotate with it.

What is wrong?

Thanks in advance,

Marc-Hendrik


Post a reply to this message

From: ingo
Subject: Re: uv_mapping again - how to?
Date: 17 Apr 2001 18:17:20
Message: <Xns90873450EBD1seed7@povray.org>
in <3adc9cd6@news.povray.org> Marc-Hendrik Bremer wrote:

> I exported a simple plane out of 32 patches an tried to map a png
> on it. The union lies in the x/z-plane. As the image_map is in the
> x/y-plane, I rotated it x*90.

You don't need to rotate the image_map. The part of a texture that is 
used for uv_mapping is the part in the xy-plane going from <0,0> to 
<1,1>

> The code I added to the union:
> 
You'll have to add uv_mapping and the texture to use to each patch, not 
only to the union. Also you may need to add the uv_vectors. If you use
uv_vectors  <0,0>,<1,0>,<1,1>,<0,1>, this wil map the texture in the 
above mentioned area to each patch. If you want to to map your image 
over several patches yoou'll have to divide the uv_vectors to smaller 
areas. See example below.

---%<------%<---
#version unofficial MegaPov 0.7
global_settings{assumed_gamma 1}
camera {location <0,0,-3> look_at 0}
light_source { <500,500,-500> rgb 1 }

#declare Bic_Tex=texture { 
   pigment {
      wood
      frequency 4
      turbulence 0.1
      octaves 7
      lambda 0.5
      omega 0.5
      color_map {
         [0, rgb 0]
         [1, rgb 1]
      }  
   }
   translate <0.25,0.5,0>
}

union{
bicubic_patch {
   type 1 
   flatness 0 
   u_steps 3 
   v_steps 3
   <0,0   ,0>,<0.33,0   ,0>,<0.67,0   ,0>,<1,0   ,0>
   <0,0.33,0>,<0.33,0.33,0>,<0.67,0.33,0>,<1,0.33,0>
   <0,0.67,0>,<0.33,0.67,0>,<0.67,0.67,0>,<1,0.67,0>
   <0,1   ,0>,<0.33,1   ,0>,<0.67,1   ,0>,<1,1   ,0>

   //uv_vectors  <0,0>,<0.5,0>,<0.5,0.5>,<0,0.5>
   uv_mapping
   texture {Bic_Tex}
   translate <-1,-1,0>
   
}

bicubic_patch {
   type 1 
   flatness 0 
   u_steps 3 
   v_steps 3
   <0,0   ,0>,<0.33,0   ,0>,<0.67,0   ,0>,<1,0   ,0>
   <0,0.33,0>,<0.33,0.33,0>,<0.67,0.33,0>,<1,0.33,0>
   <0,0.67,0>,<0.33,0.67,0>,<0.67,0.67,0>,<1,0.67,0>
   <0,1   ,0>,<0.33,1   ,0>,<0.67,1   ,0>,<1,1   ,0>

   uv_vectors <0.5,0>,<1,0>,<1,0.5>,<0.5,0.5>
   uv_mapping
   texture {Bic_Tex}
   translate <0,-1,0>
}

bicubic_patch {
   type 1 
   flatness 0 
   u_steps 3 
   v_steps 3
   <0,0   ,0>,<0.33,0   ,0>,<0.67,0   ,0>,<1,0   ,0>
   <0,0.33,0>,<0.33,0.33,0>,<0.67,0.33,0>,<1,0.33,0>
   <0,0.67,0>,<0.33,0.67,0>,<0.67,0.67,0>,<1,0.67,0>
   <0,1   ,0>,<0.33,1   ,0>,<0.67,1   ,0>,<1,1   ,0>

   uv_vectors  <0,0.5>,<0.5,0.5>,<0.5,1>,<0,1>
   uv_mapping
   texture {Bic_Tex}
   translate <-1,0,0>
}

bicubic_patch {
   type 1 
   flatness 0 
   u_steps 3 
   v_steps 3
   <0,0   ,0>,<0.33,0   ,0>,<0.67,0   ,0>,<1,0   ,0>
   <0,0.33,0>,<0.33,0.33,0>,<0.67,0.33,0>,<1,0.33,0>
   <0,0.67,0>,<0.33,0.67,0>,<0.67,0.67,0>,<1,0.67,0>
   <0,1   ,0>,<0.33,1   ,0>,<0.67,1   ,0>,<1,1   ,0>

   uv_vectors  <0.5,0.5>,<1,0.5>,<1,1>,<0.5,1>
   uv_mapping
   texture {Bic_Tex}
}
rotate <0,0,45>
}
---%<------%<---





Ingo

-- 
Photography: http://members.home.nl/ingoogni/
Pov-Ray    : http://members.home.nl/seed7/


Post a reply to this message

From: Marc-Hendrik Bremer
Subject: Re: uv_mapping again - how to?
Date: 18 Apr 2001 03:24:26
Message: <3add412a@news.povray.org>
Uh oh, .... okay, I'll try that ....
I wonder, if this is really the supposed behaviour, because it is that
different from the rest of Pov. OTOH, how should Pov know which patch is
meant to have which uv-co-ordinates.

Thanks for your help,

Marc-Hendrik


Post a reply to this message

From: Mick Hazelgrove
Subject: Re: uv_mapping again - how to?
Date: 18 Apr 2001 04:23:04
Message: <3add4ee8$1@news.povray.org>
The best way of uv mapping a image on a hamapatch object is to export as a
obj file and use uv mapper to create the image map. Gilles has written an
excellent tutorial on the subject which you should be able to find on his
site.

Mick

"Marc-Hendrik Bremer" <Mar### [at] t-onlinede> wrote in message
news:3adc9cd6@news.povray.org...
> Hi,
>
> I give it up. I don't understand how to map an image on a union of
> bezier_patches created in Hamapatch.
>
> I exported a simple plane out of 32 patches an tried to map a png on it.
The
> union lies in the x/z-plane. As the image_map is in the x/y-plane, I
rotated
> it x*90.
>
> The code I added to the union:
>
> uv_mapping
>  texture{pigment{rgb 1}}
>  texture{ pigment {
>     image_map{
>       png "Flagge.png" // the file to read (iff/gif/tga/png/sys)
>              map_type 0 // 0=planar, 1=spherical, 2=cylindrical, 5=torus
>              interpolate 2 // 0=none, 1=linear, 2=bilinear, 4=normalized
> distance
>              once
>            } // image_map
>           rotate x*90          }
>         }
>
> What is wrong? I only get stripes of my image, streched in the z-axis.
> In addition, if I rotate the object, the texture does not rotate with it.
>
> What is wrong?
>
> Thanks in advance,
>
> Marc-Hendrik
>


Post a reply to this message

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