Sign in to follow this  
martiniinthemorning

NURBS continuity - howto in opengl?

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


Link to post
Share on other sites
Nik02    4348
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 this post


Link to post
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 this post


Link to post
Share on other sites
Nik02    4348
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 this post


Link to post
Share on other sites
Nik02    4348
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 this post


Link to post
Share on other sites
Sneftel    1788
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 this post


Link to post
Share on other sites
Nik02    4348
Quote:
Original post by Sneftel
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.


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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this