|
|
On Fri, 23 Apr 1999 21:48:09 +0200, ingo <ing### [at] ingodemonnl> wrote:
>While exploring the bezier patches, I can not find a way to attatch two, non
>flat, patches without a seam. To get an idea of what I'm trying run the included
>scene.
If you look at my IRTC entry for the january-february stills round, you'll
find my bedsheet object, which is made out of a couple of hundred patches
that are all joined smoothly. Read the code and you might be able to get
a feel for what needs to happen for it to work. There's also a preview
mode built-in to that .inc file that can show you the control mesh for all
of the patches, which may help you follow along with the explanation I'm
about to try to give.
First, let me try an appeal to 2d thinking. If you've ever used a drawing
tool like Corel Draw or Illustrator or Photoshop's paths, you've probably
seen the 'barbells' that one uses to edit a node. When the two arms of the
barbell form a straight line, the node is smooth. "Break" the barbell, and
you get a point at that node. Mathematically, the angle of the barbell
represents the tangent to the curve at that point. The length of the barbell
represents the "tension." If the tangents align, the curve is smooth (C1).
If the lengths are also the same, you have higher-order continuity (which
may be important for certain lighting calculations.)
Okay, now for the ugly ASCII graphics. If you're not reading this in a
real newsreader, you may have to switch to a monospaced font now.
X # # X
X O----X----X----O X
| | | |
# X----#----#----X #
| | | |
# X----#----#----X #
| | | |
X O----X----X----O X
X # # X
That thing is supposed to be a single bicubic patch. The unconnected
symbols to all sides are supposed to be the points on adjacent patches.
Now, I'm going to ask you to change how you visualize a bicubic patch.
Instead of looking at all those points as having equal stature, think
of them as three different kinds of points.
First, there are the points marked O. These are the corners of the
patches, and they're the only points you can absolutely guarantee the
patch will intersect. They are like the node points on your 2D spline
curve.
Second, there are the points marked X. You should look at the line
between an X and an O as a barbell, like the ones in your 2d drawing
program. If each of the two barbells through an O is straight, the
surface will be smooth at the point represented by the O. If one or
both of them is bent, you will have a seam at that point.
Finally, there are the points marked #. The line between a # and an
X should also be looked at as a barbell, but you need to realize that
the patch doesn't necessarily pass through the point marked X at all.
Nevertheless, if the barbell through an X is not straight, there will
be a seam along that edge of the patch.
So, in order to have smoothly-joined patches, you need only ensure
that the overall control mesh doesn't bend at the patch edges. If
you look at the control mesh in my bedsheet code, you should see a
lot of straight lines, particularly around the bottom edges of the
sheet. You should also see that the point at the center of each of
those lines is on the edge between two patches (edges are drawn in
a different color.)
Post a reply to this message
|
|