POV-Ray : Newsgroups : povray.beta-test : uv-mapping on bicubic_patch Server Time
1 Nov 2024 23:13:42 EDT (-0400)
  uv-mapping on bicubic_patch (Message 1 to 2 of 2)  
From: andrel linnenbank
Subject: uv-mapping on bicubic_patch
Date: 4 Feb 2002 18:51:48
Message: <3C5F1E36.C7C513A3@amc.uva.nl>
When using uv-mapping on bicubic patches sometimes the
4th coordinate in the uv_vectors behaves strange.
    uv_vectors <0,0>,<.5,0>,<.5,1>,<0,1>
is always ok, whereas
    uv_vectors <0,0>,<1,0>,<1,.5>,<0,.5>
may be distorted because the 4th coordinate is not at <0,.5> but
more like <0,1>
I say 'may be', because it does not always happen. Below is a
small program that displays twice the lower left quarter of a
gif image called 'numbers.gif' (insert own gif here).
Two patches are displayed one is correct, the other isn't.
The only difference is that one uses a macro (this is also what
I get when I literally include the patch), the other uses a
declare and is distorted in the above discribed way.

Am I doing something wrong and did I not understand the manual
or is there some crazy bug here?

    Andrel

system: windows98 pentium3 750 pov3.5b10

--- example

camera {
  location  -4*z
  direction 1.5*z
  right     x*4/3
  look_at   0
}

light_source {
  <-30, 30, -30>
  color rgb 1
}


#declare Ptch_mat=
texture{
  uv_mapping pigment{
    image_map{gif "numbers.gif"}
    rotate z*90
    scale <-1,1,1>
 }
 }


#macro ptch(k)
  object {
    bicubic_patch { type 1 flatness 0 u_steps 5 v_steps 5
      uv_vectors <0,0>,<.5,0>,<.5,.5>,<0,.5>
      <0, 0, 0>,<-.5,1,0>,<-.5,2,0>,<0,3,0>,
      <1, -.5, 0>,<1,1,0>,<1,2,0>,<1,3.5,0>,
      <2, -.5, 0>,<2,1,0>,<2,2,0>,<2,3.5,0>,
      <3, 0, 0>,<3.5,1,0>,<3.5,2,0>,<3,3,0>
    }
    translate x*-1.5+y*-1.5
    texture{Ptch_mat}
  }
#end

#declare ptch0=
  object {
    bicubic_patch { type 1 flatness 0 u_steps 5 v_steps 5
      uv_vectors <0,0>,<.5,0>,<.5,.5>,<0,.5>
      <0, 0, 0>,<-.5,1,0>,<-.5,2,0>,<0,3,0>,
      <1, -.5, 0>,<1,1,0>,<1,2,0>,<1,3.5,0>,
      <2, -.5, 0>,<2,1,0>,<2,2,0>,<2,3.5,0>,
      <3, 0, 0>,<3.5,1,0>,<3.5,2,0>,<3,3,0>
    }
    translate x*-1.5+y*-1.5
    texture{Ptch_mat}
  }

object{ptch(0) scale .35 translate <-.7,0,0>}
object{ptch0 scale .35 translate <.7,0,0>}


Post a reply to this message

From: Ron Parker
Subject: Re: uv-mapping on bicubic_patch
Date: 5 Feb 2002 22:37:34
Message: <slrna61982.3kd.ron.parker@fwi.com>
On Tue, 05 Feb 2002 00:50:15 +0100, andrel linnenbank wrote:
> Am I doing something wrong and did I not understand the manual
> or is there some crazy bug here?

It's not you; it was a bug.  It's been fixed for the next beta.

--
#macro R(L P)sphere{L __}cylinder{L P __}#end#macro P(_1)union{R(z+_ z)R(-z _-z)
R(_-z*3_+z)torus{1__ clipped_by{plane{_ 0}}}translate z+_1}#end#macro S(_)9-(_1-
_)*(_1-_)#end#macro Z(_1 _ __)union{P(_)P(-_)R(y-z-1_)translate.1*_1-y*8pigment{
rgb<S(7)S(5)S(3)>}}#if(_1)Z(_1-__,_,__)#end#end Z(10x*-2,.2)camera{rotate x*90}


Post a reply to this message

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