Sign in to follow this  

Tangents for Bézier Curves

Recommended Posts

Hello Everybody,

i just read Chapter 23 GPU Gems 2. It's about rendering hairs. You can read it [url=""]here[/url].
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
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.

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

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

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

[/b]I hope I've done a clear explanation =)[b]

UPD:[/b][b] [/b]I guess the article uses very similar, if not exactly the same approach

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this