Wed, Nov 20, 1:23 AM CST

Renderosity Forums / Poser Technical



Welcome to the Poser Technical Forum

Forum Moderators: Staff

Poser Technical F.A.Q (Last Updated: 2024 Nov 13 12:50 am)

Welcome to the Poser Technical Forum.

Where computer nerds can Pull out their slide rules and not get laughed at. Pocket protectors are not required. ;-)

This is the place you come to ask questions and share new ideas about using the internal file structure of Poser to push the program past it's normal limits.

New users are encouraged to read the FAQ sections here and on the Poser forum before asking questions.



Checkout the Renderosity MarketPlace - Your source for digital art content!



Subject: Curve type for spline interpolation?


kuroyume0161 ( ) posted Mon, 19 November 2007 at 5:11 PM · edited Wed, 20 November 2024 at 12:09 AM

Any ideas?  I'm leaning towards Hermite as Bezier 'control points' don't necessarily lie on the curve while Hermite must.

Thanks,
Robert

C makes it easy to shoot yourself in the foot. C++ makes it harder, but when you do, you blow your whole leg off.

 -- Bjarne Stroustrup

Contact Me | Kuroyume's DevelopmentZone


kuroyume0161 ( ) posted Tue, 20 November 2007 at 4:10 PM

Anything?  I'm not getting great results with Kochanek–Bartels (TCB) splines.  I'ma thinking that there is more to this than considering a keyframe and its previous and next as everyone else does for interpolation (including tangents) since Poser imparts a 'continuous' curve over a continuous set of spline keys.

C makes it easy to shoot yourself in the foot. C++ makes it harder, but when you do, you blow your whole leg off.

 -- Bjarne Stroustrup

Contact Me | Kuroyume's DevelopmentZone


Miss Nancy ( ) posted Tue, 20 November 2007 at 5:06 PM

it's greek to me. the first thing I do in any animation is make certain everything is either non-animating or linear. do you have a set of animations which compare the methods?



nruddock ( ) posted Tue, 20 November 2007 at 6:00 PM

Attached Link: http://en.wikipedia.org/wiki/Catmull-Rom_spline

Try the Catmull-Rom formulation. The tangent definitions are different from the Kochanek-Bartels formulation.


kuroyume0161 ( ) posted Tue, 20 November 2007 at 6:12 PM

I've examined Catmull-Rom splines but they seem to require constant sampling (keyframes would need to be evenly spaced in time).  The results are not great otherwise.  Time to do a Giggle search of nonuniform sampling in that respect. :)

C makes it easy to shoot yourself in the foot. C++ makes it harder, but when you do, you blow your whole leg off.

 -- Bjarne Stroustrup

Contact Me | Kuroyume's DevelopmentZone


kuroyume0161 ( ) posted Tue, 20 November 2007 at 11:39 PM

Dump the Catmull-Rom's.  Natural Cubic Splines seem to match what is seen in Poser - changing a control point changes the spline globally and the points are on the spline.  Sound familiar?

Problem is that I understand this even less - this is a set of equations to be solved (read: matrix). :)  One difficulty here is that I need a tangent VECTOR (x,y) and all of these splines return a tangent direction (however that is interpreted).  I don't need to determine (and can't use) the interpolated points on the curve, just the tangent vectors to get a close approximation of Poser's curves.

Argggghhhh....

C makes it easy to shoot yourself in the foot. C++ makes it harder, but when you do, you blow your whole leg off.

 -- Bjarne Stroustrup

Contact Me | Kuroyume's DevelopmentZone


kuroyume0161 ( ) posted Wed, 21 November 2007 at 10:06 AM

Not being a mathematician (I just play one on the internet), I have now found that the 'tangent' value, also termed a Gradient, is just the derivative dy/dx of the curve and is the same as tan(angle).  That helps a bit.  It doesn't give me a magnitude for the tangent vector though, just the angle.

Learning about spline curves is like relearning over again.  Some of these maths haven't been touched upon for some time - lots of dust on the old noggin.  Looks like I'll have to dig into some books to seek this type of information.

Now, if this all can be applied to these so-called Natural Cubic Splines, I might have an exact duplication of Poser animation curves.  Methinks the reason why there are no tangents to fiddle with in Poser is because this type of curve doesn't easily model them - it is a point on the curve generator more than anything.  So, let's see what can be extracted that resembles a tangent.

C makes it easy to shoot yourself in the foot. C++ makes it harder, but when you do, you blow your whole leg off.

 -- Bjarne Stroustrup

Contact Me | Kuroyume's DevelopmentZone


kuroyume0161 ( ) posted Wed, 21 November 2007 at 12:21 PM

It's nice to have a god to pray to... or in this case, the ability to talk to the likes of Dave Eberly.  He has been the most helpful, easiest person to talk about such complex matters.  I've discussed many varied things with him: Euler angle conversions, IK solvers, and now Spline curves (among others).  For a guy who's written a dozen books or more and dozens of papers he is really accessible and doesn't seem to mind helping (or at least doesn't get upset about it). :)

With his help, I might have this nixed soon.  Algorithms are great except when they take shortcuts for results which don't align with yours.  It seems totally apparent that the tangent VECTOR can be achieved with the TCB spline math - I'll just not stare at the available algorithms and instead stare at the equations.

C makes it easy to shoot yourself in the foot. C++ makes it harder, but when you do, you blow your whole leg off.

 -- Bjarne Stroustrup

Contact Me | Kuroyume's DevelopmentZone


kuroyume0161 ( ) posted Fri, 23 November 2007 at 9:06 PM · edited Fri, 23 November 2007 at 9:06 PM

I'm back! ;)

With more research under my belt, it appears that Poser is using some form of cubic spline interpolation with "C2 continuity".  That quoted part means that the curve isn't created just from the immediate neighbors of a particular keyframe, but considers all contiguous spline-interpolated keyframes.  You know this by the fact that changing the value of one keyframe ripples across the curves of other keyframes changing their curvature as well.

There is a natural choice here (pun intented): natural free cubic splines.  These use a set of linear equations to interpolate (create the curve or plot the points inbetween keyframes) with that aforementioned C2 continuity.  The 'free' part has to do with handling the first and last keyframes.  Cyclic ends mean that the first and last have the same tangential vectors.  Acyclic (or clamped) means that a particular tangential value is assumed (0 usually).  Free means that the adjacent keyframe of first (second) or last (next-to-last) and a pseudo keyframe (usually just a duplicate of the one under consideration) are used to get one side of the tangent vector set..

There may also be a bit of smooching, er, smoothing in Poser's spline interpolation.  After I get a working natural free spline algorithm, it will be clear, I think, if Poser is also doing some rectification using ease-in and ease-out on the tangent vectors.  It is assured that Poser isn't using Catmull-Rom (with secant tangent vectors - that is a tangent on a keyframe that is parallel to the line from the previous to the next keyframe).  So, Catmull-Rom, Hermitian, and Kochanek-Bartels (TCB) splines are out.  I just hope that they aren't using some form of Bezier or B-Spline with 'invisible' control points.

C makes it easy to shoot yourself in the foot. C++ makes it harder, but when you do, you blow your whole leg off.

 -- Bjarne Stroustrup

Contact Me | Kuroyume's DevelopmentZone


nruddock ( ) posted Sun, 25 November 2007 at 12:18 PM

Attached Link: http://www.amazon.com/Curves-Surfaces-Computer-Aided-Geometric-Design/dp/0122490541

All you ever wanted to know about curves (the link is to the 4th Edition, there do appear to be some cheap copies of the 3rd edtion available).


Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.