Public Group

NURBS continuity - howto in opengl?

This topic is 3021 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

Hi, I'm new to opengl and as to 3d programming. I would like to know how to achieve smooth join points between NURBS patches in opengl(mathematically, no 3d editors). I've learned from 3d books that to achieve at least c0 continuity between NURBS surfaces, at least each of the points will meet. And for c1 continuity, the derivatives of the NURBS basis functions should be equal. For Cn's higher derivatives are taken. I've used opengl's gluNurbsSurface function to generate NURBS. I have 3 NURBS and I had connected their edges, however these edges are not smooth. In these cases, where smoothness is important, is their a function in opengl that takes care of the smoothness of the joined edges? Or does opengl leave this calculations to its users? If it needs users to have their own calculations, then how can this be done knowing that in the first place a built-in opengl function was used to generate these NURBS surfaces?

Share on other sites
Connected NURBS patches are C1 continuous if the tangents at the edges point at exactly opposite directions. They become C2 continuous if the tangents are of exactly same magnitude as well. The tangent vector for a particular edge point is defined as (next point from the edge point)-(edge point).

It is easier to understand if you look at a 2D NURBS spline and its control points. A patch behaves exactly the same, but in two directions.

Share on other sites
"Connected NURBS patches are C1 continuous if the tangents at the edges point at exactly opposite directions. They become C2 continuous if the tangents are of exactly same magnitude as well. The tangent vector for a particular edge point is defined as (next point from the edge point)-(edge point). "

Given the control points that correspond to a NURBS' edge, do you have any idea how to make sure a different NURBS can connect to this edge with c1/c2 continuity, using Math? By theory, getting the NURBS equations of the 2 NURBS and making sure their derivatives are equal at a certain edge(points) will achieve a c1 continuity. Please correct me if I'm wrong.

Share on other sites
I'm not so good at formal maths as to be able to explain it purely in mathematical terms. However, consider a spline:

The image depicts two Bézier splines (just a special case of NURBS) joined at one point. Since tangents T0 and T1 are exactly collinear, the joint can be considered as C1 continuous. In addition, since the tangents are of exactly same magnitude, the second derivatives of the splines at the point are also same, thus C2.

Note that this assumes that the knot distribution is equal at both ends.

If you expand this to surfaces, the same principle holds.

Share on other sites
Doesn't the collinearity alone give you G1 continuity, not C1 continuity?

Share on other sites
C1 is effectively tangential continuity.

The difference between C2 and G2 is the uniformity requirement of the knots, as C2 requires that the parametrization along the curves is equal at the joint whereas G2 doesn't.

Share on other sites
I don't think that's right... tangential continuity is G1, not C1. If the tangents are collinear but not of equal magnitude, then the first derivative is not continuous. If, for example, the spline was being used for animation, there would be an instantaneous acceleration at the knot.

Share on other sites
Quote:
 Original post by SneftelI don't think that's right... tangential continuity is G1, not C1. If the tangents are collinear but not of equal magnitude, then the first derivative is not continuous. If, for example, the spline was being used for animation, there would be an instantaneous acceleration at the knot.

You're right, I got my C1:s and G1:s mixed up in this case. I stand corrected.

I've checked my statements in this thread, and I believe everything else I said can be taken verbatim.

• 10
• 16
• 14
• 18
• 15