# 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.

## 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.
[/quote]

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.

Nils

##### Share on other sites
hi,

you have to compute the drivatives I guess.
http://www.cs.sunysb.edu/~qin/courses/geometry/4.pdf

##### 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 =)

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

##### Share on other sites
Thank you for your fantastic advices. I think with the great explanation and the nice article i can get some nice results. Thank you!

• 11
• 20
• 12
• 10
• 38
• ### Forum Statistics

• Total Topics
631401
• Total Posts
2999864
×