PDA

View Full Version : Rational Bezier Curves



Virgee
01-31-2007, 11:24 PM
Hello,
I have a question about rational bezier curves (that is those with w (weight) coord).Rational Beziers do not behave correctly when increasing/decreasing control point's weight.

The curve should go closer to the point with increseaing weight. Following picture showes that very well - http://commons.wikimedia.org/wiki/Image:Rational_Bezier_curve-conic_sections.svg

But with OpenGL evaluators (at least on my ATI Radeon using both Ubuntu Linux and Windows XP)
it does not act like that.

Has anyone encoutered such problem ?

THX

Virgee

P.S.: If I chose wrong Category, I am sorry ;)

oc2k1
02-01-2007, 04:11 AM
The summ of all weight have to be 1.0

The theori is simple:

a + b = 1

1² = 1

(a+b)² = 1

a² + 2ab + b² = 1

That are the 3 coefficinets for the bezier curve. Curves of this type arent a problem with evaluators. Your curves cooefficients are descibed by:

a² + 2abw + b² = 1

IMHO the evaluator are unaccelerated. They are creating only a mesh, but with geometrieshaders it would be simple to tesselate a quad with additional controllpoints (or Tangent and Bitangent vectors) to a Bezier surface. The problem is that a GF8 is needed.

Another idea is to store the controllpoint data as uniform vars for a vertexshader, and a simple 2d quadmesh as vertexstream. Then the bezier calculation could be done by the GPU. But a problem is that changing uniform vars isn't fast (so it's only usfull for realy big and high tesselated bezier patches, but not for a trueform replacement)