On 25/10/2013 at 10:18, xxxxxxxx wrote:
User Information:
Cinema 4D Version: r14
Platform:
Language(s) : C++ ;
---------
Hi,
i am trying to get real unit distances along a spline. this is what i've tried so far, in various combinations. but until now with no luck. i want to find a point on a spline which is for example 20meters from the start of the spline.
SplineLengthData* splLengthData = SplineLengthData::Alloc();
splLengthData->Init(baseSpline,0,NULL);
if (!splLengthData) return false;
SplineHelp* splHelp = SplineHelp::Alloc();
if (!splHelp) return false;
splHelp->InitSpline(railSpline,Vector(0),0,false,true,false,true);
Real rp0 = splHelp->GetOffsetFromReal(myOffset,0);
//Vector p0=splHelp->GetPosition(rp0,0,true,true);
Vector p0=splHelp->GetPosition(splLengthData->UniformToNatural(rp0),0,true,true);
hope someone can point me into the right direction.
PS: interesting thing is, that it seems to work with an arc-spline but not with a completely free defined spline
cheers,
Ello