Sign in to follow this  
NilsSchlemminger

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="http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter23.html"]here[/url].
I want to implement this technique but have one problem: In the tesslation step they write:
[quote]
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 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
[img]http://s006.radikal.ru/i214/1105/be/3306639b7908.jpg[/img]

[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.
[img]http://i028.radikal.ru/1105/78/3c3b563e7570.jpg[/img]

[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].
[img]http://s45.radikal.ru/i110/1105/eb/915d2eb37b0a.jpg[/img]

[/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