UniformTonatural on PrimitiveSplines?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 09/09/2005 at 17:02, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   9.102 
    Platform:    Mac  ;  
    Language(s) :   C.O.F.F.E.E  ;

    ---------
    A problem that makes me go round in circles.
    To get an even movement on a regular spline I use "UniformTonatural" option.
    It works fine like this:
    <CODE>var type1 = OBJ1->GetType();
    // Is Spline
    if ( type1 == 5101)    
    {
    println("OBJ1 Is Spline");
    OBJ1->InitLength(0 );
    var spos1 = OBJ1->GetSplinePoint(OBJ1->UniformTonatural(POS1) , 0);

    op->SetPosition(OBJ1->GetMg()->GetMulP(spos1));
    OBJ1->FreeLength();

    }
    else
    </CODE>

    I can not for the life of me get the same thing to happen when using a PrimitiveSpline,
    like Rectangle, Cogwheel etc.
    The same principle as with a regular spline doesn't seem to apply. I got it working with the default function, that is, it moves slow in the corners and fast on straighter parts.
    Like this(InitLength and FreeLength are commented here).

    <CODE>/// Is Primitive Spline
    if ((type1>5174 && type1<5190))
    {
    println("OBJ1 Is PrimitiveSpline");
    //OBJ1->GetSplineObject()->InitLength(0);

    var spos1 = OBJ1->GetSplineObject()->GetSplinePoint(POS1 ,0); // <<How to implement UniformTonatural here??
    op->SetPosition(OBJ1->GetMg()->GetMulP(spos1));
    //OBJ1->GetSplineObject()->FreeLength();
    }
    else</CODE>
    I've tried all possible settings and combination based on the previous example I can think of, but no go....
    Any input is most welcome.

    Cheers
    Lennart

    PS UniformTonatural doesn't get spelled correctly when posting it.
    It is spelled correct in my code with a big "N". DS



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 10/09/2005 at 13:53, xxxxxxxx wrote:

    Not to make another cliffhanger with no answer/solution, I got this working with the help of mdme_Sadie and JDP over at CGTalk.
    //////
    var myspline=OBJ1->GetSplineObject();
    if (!myspline) return FALSE;

    if (!myspline->InitLength(0)) return FALSE;

    var pos=myspline->GetSplinePoint(0.5,0);
    /////
    as well as:
    //////
    var op = OBJ1->GetSplineObject();
    op->InitLength(0);
    ///////

    Cheers
    Lennart


Log in to reply