PDA

View Full Version : COFFEE | pointprecision along a spline


tcastudios
05-28-2007, 11:25 PM
Is there a more exact way of getting the position along a spline?
With COFFE I use something like:


EXPRESSION::GetGlobalPosition(spline,position)
{
spline->InitLength(0);
var locpos = spline->GetSplinePoint(spline->UniformToNatural(position));
return spline->GetMg()->GetMulP(locpos);
}

////
var spline = tag#ID_USERDATA:1;
var position = tag#ID_USERDATA:2;

var pos = GetGlobalPosition(spline,position);
op->SetPosition(pos);


The problem I have is a "pumping" position along the spline for each
point along the spline. I thought I did something wrong but
the result is the very same if I use Cinemas own AlignToSpline Tag.
The problem is the same. Using the AlignToSpline tag, of coarse setting the spline
to Uniform, and rising the subdivision to high values does not help.

Subdividing the actual (curved)spline does not help either since the subdivision does the "same"
strange miscalculation.

The cumbersam way of getting it better is to create a -straight- spline that is highly
subdivided and use the Mograph Spline Warp to "glue" it to the original spline
(plus duplicate it and use a expresso setup to have a deformed state that can be used).

Attached is a (R10) scene using the regular ATS tag as well as the SplineWarp check.
It is just a check, I'd like to find a solution getting the "correct" point using COFFEE thou.

Cheers
Lennart Wåhlin - tcastudios

Per-Anders
05-28-2007, 11:34 PM
COFFEE has no access to the splinehelp class currently that mograph uses to get it's correct even distribution along the splines. It would be a lot of work to get COFFEE to get the even (realworld units/distance percentage) position along a spline.

tcastudios
05-28-2007, 11:46 PM
I see, thanks.
Is that a mograph class or is it accesable with regular C++ programming?
(Even thou I'm not into C++ myself)

Cheers
Lennart

Per-Anders
05-28-2007, 11:50 PM
It's available in the C++ SDK

tcastudios
05-29-2007, 07:52 PM
It would be a lot of work to get COFFEE to get the even (realworld units/distance percentage) position along a spline.

Sorry to be a slowhead... Is that alot of work to get it into the COFFEE SDK or, alot of work
doing it using COFFEE as it is? I don't mind work per se. If so, any "frame thinking" how to approach it?

Cheers
Lennart

Per-Anders
05-29-2007, 08:09 PM
It's a lot of work using COFFEE, and i'm not sure if you could ever get it totally precise as I don't know if you can get the line object and it's points in COFFEE. You can though use the spline effector from mograph or even the matrix/cloner objects in object mode cloning along a spline to get precise points along any spline.

tcastudios
05-29-2007, 08:37 PM
Thanks.
So would anyone know if the Lineobject can be reached in COFFEE? (Off to check whats in the COFFEE SDK meanwhile). I'll have to take it from there and see.

I did a setup using SplineWarp that came close enough to linear (attached in first post).
However the shear amount of points bogges down the editor to almost a halt in a real scene.

I really wonder, why is not the deformed state of an object directly accessable?
Why does one have to make the extra turn around expresso and doubling the object?
I can ,personaly, not come to think of a single situation where the deformed state is not wanted, i.e to attach an object using AlignToSpline to a wavy spline.


Cheers
Lennart

CGTalk Moderation
05-29-2007, 08:37 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.