Bezier curves

Started by
1 comment, last by Krohm 11 years, 11 months ago
Do I simply just draw a line list to approximate a bezier curve in DirectX? Or is there a more efficient way to do it. Additionally, it probably is more efficient just to use cubic splines instead of applying de Casteljau's algorithm on every single control point, but I'm a bit confused how to do it while keeping the curve's first derivative continuous.
what
Advertisement
If you're looking for a simple plotting algorithm, you can evaluate the Bezier polynomial along t in the range [0;1] and set the corresponding pixels.

With shaders you could draw the convex hull (control points) of the Bezier curve as a triangle strip/fan and then for each fragment evaluate the distance to the bezier curve. If that is below a cerain treshhold (call it line thickness), then you fill the pixel.
I suggest to look at
Resolution Independant Curve Rendering using Programmable Graphics Hardware.
The naive algorithm is really easy, albeit rendering quality suffers quite a bit.

Also look at
Improved Alpha-Tested Magni?cation for Vector Textures and Special Effect

Previously "Krohm"

This topic is closed to new replies.

Advertisement