Solved

Knots in opengl nurbs

Posted on 2002-04-27
3
1,446 Views
Last Modified: 2013-12-26
I have the points on the outside of an object.  This object is a distorted cylinder in shape, and there are 40 points in it. I want to make a nurbs surface from theses points, but cannot figure out what the knots are or how to compute them.  All the examples I can find have an array of even size (how do they find this size??) containing half zeros and half ones {0,0,0,1,1,1) for example.  Trying random knot arrays either draws nothing at all or a very strange shape that passes through 2 or more points from the object but looks like a wadded up piece of paper.  Also, do the points in the object need to be in some specific order?  Should the object be drawn with 2 nurbs (all examples are a distorted plane, not cylindrical)??
Thanks...


0
Comment
Question by:jonnin
  • 2
3 Comments
 
LVL 4

Expert Comment

by:ct.smith
ID: 6973656
I suggest that as knots are a fairly fundamental concept to b-splines (including NURBS), you may want to pickup a graphics  or computational geometry textbook.  It's a classic topic, so there should be no sortage of good references.  I'll try and give an explanatation here, but it's the sort of thing that's much easier when you have some pictures to go with it.

The knots are essentially points in a space where the b-spline basis functions are evaluated.  The results of the basis functions over the knots mapped to the rendering space is what gives the b-spline or b-spline surface.

The array that you bring up is that of the knot indeces.  For n knots, you could use the sequence {0, 0, 0, 1, 2, ..., k-1, k-1, k-1}.

---

As an aside, it's my opinion that NURBS are seriously constraining and outdated.  There are far better and easier solutions to creating nice surfaces, my favourite technique being subdivision.
0
 
LVL 2

Author Comment

by:jonnin
ID: 6977040
I have books, but they do not explain it well. (math and what a knot is in those terms, but not how to pick them or how many to use). I'm not buying another just for this; I only do graphics about one week a year =)  
So how many knots are needed? Gl will not draw anything unless the right number of knots is used.  

My object was a bajillion triangles from 3d max, I was going to try a nurbs to improve performance (just to see) before trying to decrease the triangles in max.
0
 
LVL 4

Accepted Solution

by:
ct.smith earned 200 total points
ID: 6977857
It's too bad you don't want to sit down with a book for this one, but if cost is the only concern then a you may find a library useful :)

Anyways, a cubic b-spline needs a minimum of four knots to start, anything beyond four is where you'll start to see a reasonable surface.  There is no maximum number of knots.   In general, three knots to correspond to you first geometric control point, three for the last and one for each in between.

Just a caveat, NURBS are quite prone to problems such as tearing and catastrophic cusping, so they are really only appropriate for open surfaces.  For a complex model that has closed surfaces, you may find the results dissappointing.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris. Well, a long time ago, in a galaxy far far away, I was…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now