PDA

View Full Version : [HELP] Normal of a spline ?

 mattjakob01-21-2010, 05:03 PMIs there a way to get the normal or the binormal of a spline at a point u[0,1]? Basically I want to algorithmically build a spiral around an arbitrary spline. thanks :) PS: the way Im doing it is calculating the rotation matrix and then the trasformation matrix, but it's quite computational...
denisT
01-21-2010, 05:58 PM
Is there a way to get the normal or the binormal of a spline at a point u[0,1]?
Basically I want to algorithmically build a spiral around an arbitrary spline.

thanks :)

PS: the way Im doing it is calculating the rotation matrix and then the trasformation matrix, but it's quite computational...

Shape Common Properties, Operators, and Method
pathTangent <shape> [ <curve_num> ] <parameter>
lengthTangent <shape> [ <curve_num> ] <parameter> [ steps:<integer> ]
(see MXS help for details)

and always you can get positions of two points on the spline with some delta and calculate the vector

mattjakob
01-21-2010, 06:22 PM
maybe Im getting it wrong but those two parameters are pretty much the same (diff is lenghTangent gives you the tangent vector at a specified step) ... that's kind of the easy thing. What it;s hard to get is the normal or binormal vector to it :)

thanks anyway

biddle
01-21-2010, 06:38 PM
As Denis pointed out, Maxscript will provide you with the tangent T to the curve at any point, which gives you the plane perpendicular to the curve at that point.

The last time I went looking, it didn't tell you what values to use for the normal N and binormal B vectors (some people maintain that the proper term for TxN is the bitangent vector...) in that perpendicular plane.

There are numerous ways to derive those quantities and the 'best' (simplest) solution depends on how arbitrary your 'arbitrary spline' is. Is it ever a straight line along its length? Does it have any inflection points where the curvature goes to zero? Is it constrained to a manifold with a surface normal, etc..

You might want to google "Frenet-Serret Frame" "Parallel Transport Frame" and "Quaternion Frenet Frame" for ideas on how to calculate what you need.

Unfortunately I left my copy of "Visualizing Quaternions" at home today :(

mattjakob
01-21-2010, 06:49 PM
Indeed I calculated it using a 4x4 rotation matrix and added a transform to the point. A bit slow but it works.
Left my copy of the book at home as well ;-)

thanks.

CGTalk Moderation
01-21-2010, 06:49 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.