[Closed] [HELP] Normal of a spline ?
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
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
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
Indeed I calculated it using a 4×4 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.