Re: [Pipmak-Users] Different patches positioning
Status: Alpha
Brought to you by:
cwalther
From: Christian W. <cwa...@gm...> - 2008-01-03 21:49:09
|
Andrea Viarengo wrote: > I have tryed to compile SVN Build 144=20 > (I think this build correspond more or less to version 0.2.6, isn't it?= ) >=20 > This build compiled with MS Visual C++ work exactly as your official ve= rsion=20 > 0.2.6 >=20 > I have posted screenshots to=20 >=20 > http://viarengo.altervista.org/download/Patch.zip >=20 > You could see separation line between patches. OK... I've studied this, and I have determined that the new behavior=20 (tested in rev. 170, probably unchanged since 155) is correct, and the=20 old behavior (in Pipmak 0.2.6) is wrong. If that confuses you, read section 2.9 "Patches" in the reference, in=20 particular the top left part of figure 5, and the following paragraph=20 under "Advanced Placement in 3D": Width and height of the patch can also be speci=EF=AC=81ed in normaliz= ed=20 units using the nw and nh parameters. Unlike w and h, which give the=20 total width and height of the patch, these parameters describe the=20 visible width and height. On panoramas and slides, this is one patch=20 pixel less than the total width or height because a margin of half a=20 pixel is cut off each side of the patch, so that the centers of the=20 outermost pixels lie on the edge, to enable a bilinearly interpolated=20 patch to blend seamlessly into a bilinearly interpolated background=20 image. This is similar to what=E2=80=99s done with the cube faces as desc= ribed=20 under =E2=80=9CMaking Cubic Panoramas=E2=80=9D in section 2.8 =E2=80=9CCu= bic Panoramas=E2=80=9D. As an=20 example, this means that to make a patch of the same size coincide with=20 cube face 1 (the same thing that would be accomplished by setting face =3D= =20 1, x =3D 0, y =3D 0), you would specify anchorh =3D 0.5, anchorv =3D 0.5,= nx =3D=20 -1, ny =3D 1, nz =3D -1, nw =3D 2, nh =3D 2. You're relying on a bug in Pipmak 0.2.6 that causes the 0.5 pixel offset = to be applied in the wrong direction for patches with negative height,=20 making the patches overlap. Try giving your patches positive heights,=20 and you'll see that you get these gaps even in 0.2.6. You should easily be able to get rid of the gaps by positioning your=20 patches using normalized coordinates (don't forget anchorh =3D 0.5,=20 anchorv =3D 0.5). -Christian |