Jump to content
  • Advertisement
Sign in to follow this  

Tangents for Bézier Curves

This topic is 2579 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello Everybody,

i just read Chapter 23 GPU Gems 2. It's about rendering hairs. You can read it here.
I want to implement this technique but have one problem: In the tesslation step they write:

To compute the new vertices' positions, we convert the control hairs to Bezier curves by calculating their tangents (for every frame) and using them to compute the Bezier control points.

I know how to calculate the direction of the tangents at the specified points but how can i calculate the length of them (i think the length specifies the control point for the Bézier Curve).

I hope you can help me.


Share this post

Link to post
Share on other sites

you have to compute the drivatives I guess.

Share this post

Link to post
Share on other sites
To my mind the way you compute the tangents cannot be exactly defined.
It's a heuristic.

You can apply, for example, the following steps. These heuristics are used in CorelDraw for control points conversions.

Semgents to cusp bezier (i.e. tangents without conjunction):
For every tangent of every control point use 1/3 of distance to adjacent point as a length, direction is current point->adjacent point

Cusp bezier - smooth bezier (i.e tangents without conjunction to tangents with conjunction):
Use bisector of the tangents as their new direction, keeping lengths of the tangents.

Smooth bezier - symmetrical bezier (i.e tangents with conjunction to tangents with conjunction which have the same length):
The conversion is made by averaging the lengths of the tangents.

I hope I've done a clear explanation =)

I guess the article uses very similar, if not exactly the same approach

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!