View Full Version : tangentBezier3D @ last/first spline segments. Random results?
12-10-2011, 12:31 AM
Max 2010 SP1.
Re: tangentBezier3D @ last/first segment.
The image shows the results of obtaining the point3 tangent of a spline segment using tangentBezier3D.
There are four separate sets of results, those on the left use a 'param' value of 1.0, those on the right 0.99999.
Hopefully its evident to see that using a 'param' value of 1.0 gives different (random?) results each time, out of the four shown three of them are different, only the second and third 'run' gave identical results. I've even had it output "[-1.#QNAN,-1.#QNAN,-1.#QNAN]" as well but predictably it wouldn't when I needed a screen grab.
This seems to only happen with the last segment, all the others appear fine.
Is this something peculiar to Max 2010 SP1 or is it just me?
Does this also happen in later versions of Max?
If anyone can shed any light on this I'd very much appreciate it.
I've also asked this on Autodesk Area some 4 weeks ago but so far no joy.
12-10-2011, 05:00 PM
what the tangent is? i will not tell too much about the math but vulgarly it's a vector from p0 to p1, where p0 and p1 are first and next points on spline with some interval.
when you ask the last point on a spline (param 1.0) how can we get the next? no next - no vector - no tangent ...
the solution is to get not 1.0 path param but very close ~ 0.999 as you do in your sample.
12-10-2011, 09:40 PM
Thanks Denis, very much appreciated, i'm still a little confused though.
Are you saying that the last segment in a closed spline is treated as if it were the last segment of an open spline? If this is the case then by the same token wouldn't the first segment also suffer these random results for a param value of 0.0? Shouldn't I have to use 0.0001 as the param value for segment 1 in the same way?
The thing is, the results I get for the first segment at param 0.0 (in pink) seem to work out ok, both sides have exactly the same output.
I've also tried changing which knot is #1 but the problem just moves round with it, it's always the last segment in the spline.
Anyways, its not an issue for concern, 0.9999 will do for my needs, its more a curiosity thing than an actual problem. I'll just have to watch out for it in the future.
12-10-2011, 09:40 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.