Solved

Knots in opengl nurbs

Posted on 2002-04-27
3
1,444 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
Artificial Intelligence comes in many forms, and for game developers, Path-Finding is an important ability for making an NPC (Non-Playable Character) maneuver through terrain.  A* is a particularly easy way to approach it.  I’ll start with the algor…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

707 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

14 Experts available now in Live!

Get 1:1 Help Now