|
|
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
|
|