POV-Ray : Newsgroups : povray.advanced-users : 3D uv mapping of bezier patches : Re: 3D uv mapping of bezier patches Server Time
2 May 2024 17:20:19 EDT (-0400)
  Re: 3D uv mapping of bezier patches  
From: Le Forgeron
Date: 22 Jun 2016 03:00:24
Message: <576a3788$1@news.povray.org>
Le 21/06/2016 à 22:29, Bald Eagle a écrit :
> Is there a reference that better explains uv-mapping for bezier patches?
>
> It's hard to make heads or tails of how to construct a patch and uv-map it so
> that both the outside and the inside textures are oriented in a way that makes
> any sense.
>
> The defaults seem --- odd.   I t appears I'm not the first to think this.
> http://www.joshuarenglish.com/cyclopedia/uv_bicubic.html
> (See Section 4 at the bottom)
>
> It's unclear to me _exactly_ what the 4 uv vectors are for and what they
> specifically do.   How do they function along with the control points?

IIRC, The 4 uv vectors are the uv coordinates of the 4 corners.
i.e. the first corner of the patch get the uv values of the first uv 
vector. And so on.
The interpolation of uv values is done between 3 vertices (unless you 
are exactly on the great diagonal where the influence is only between 2 
points)


>
> I have a vague understanding of the generalities, but I would like to find some
> specifics.
>
> The following works for me, but gives an inverted interior texture when I flip
> the patch 180 degrees to view the back.

the computation of the interior texture is identical to the "external" 
texture, but you are viewing it from the other side (than the expected 
side). Interior texture is visible when the face is the internal one, 
but the mapping is the same as for the "external" texture. Same point, 
same uv coordinates whatever the side, the side only selects the 
internal or external image to extract the colour for that point.

If you use oriented images, when the mapping of the external image is 
identical to the original image, the mapping of the internal image would 
be identical to the original image when viewed in a mirror on the back 
of the textured object.

Or more easily: there should be no difference between a mapping using 
only one "external" image for both sides, and a mapping using the same 
image explicitly for the exterior and the internal side.

Which mean, of course, that the internal mapping appears reversed when 
viewed from the other side.

I usually think of the bicubic_patch as a real flag, attached to a pole. 
If your image is a lion or an heraldic leopard, one side is to the pole, 
another is away from it. Let say the tail is to the pole, whatever the 
side, the tail is nearer the pole. One side of the mapped picture is 
identical to the original, but the other side is viewed as inverted, 
when considering the left & right concept, yet it is "away from the 
pole" on both sides.


>
>  //  Control points arranged from origin over and up
>  //  >>> UV VECTORS ARRANGED clockwise from top left around right and down
> around to bottom left <<<
>  bicubic_patch {
>   type 1
>   flatness 0
>   u_steps 3
>   v_steps 3
>   //  default
>   //  uv_vectors <0,0>,<1,0>,<1,1>,<0,1>
>   uv_vectors
>   <0, 1> <1, 1> <1, 0> <0, 0>
>   <X13, Y13, Z13>, <X14, Y14, Z14>, <X15, Y15, Z15>, <X16, Y16, Z16>,
>   < X9,  Y9,  Z9>, <X10, Y10, Z10>, <X11, Y11, Z11>, <X12, Y12, Z12>,
>   < X5,  Y5,  Z5>, < X6,  Y6,  Z6>, < X7,  Y7,  Z7>, < X8,  Y8,  Z8>,
>   < X1,  Y1,  Z1>, < X2,  Y2,  Z2>, < X3,  Y3,  Z3>, < X4,  Y4,  Z4>
>   uv_mapping
>     interior_texture  {pigment {image_map {png "UVtesttexture1.png"} scale 1}
> finish {phong 0.6 phong_size 20} }
>     texture {pigment {image_map {png "UVtesttexture2.png"} scale 1} finish
> {phong 0.6 phong_size 20} }
>  }  //  end bicubic_patch 1
>
>
> I would like to do some further write-ups and diagrams if I can noodle this all
> out.
>
> Has anyone else done any bezier patch experiments who could provide some
> information and/or SDL?
>
> Thanks.
>
>
>


Post a reply to this message

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