Cannot get correct point values on spline



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

    On 14/10/2006 at 10:11, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   9.6 
    Platform:      
    Language(s) :     C++  ;

    ---------
    Hi,
    Ive come into a really strange problem

        
        
        
        
        SplineObject *spline = static_cast<SplineObject*>(doc->GetActiveObject());
        
        
        
        
        Vector *points = spline->GetPoint();
        
        
        
        
        Vector p = Vector(0);
        
        
        
        
        p = points[1];
        
        
        
        
        Vector u = !p;
        
        
        
    

    If I create a default Circle Primitive, make it editable (and leave it at its default location)
    then I run the above code.
    In Cinema 4D, the second point on the spline is at location <0, 200, 0>. Cinema 4D reports this and you can clearly see it too.
    When I attempt to use the coe above, the resulting vector is <1.22, 200, 0> and its unit vector is <6.0, 1.0, 0>
    Why is this? How is it even possible to have a unit vector with a 6 on the x?
    Ive been staring at this for the past hour now, and I can't see whats wrong



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

    On 16/10/2006 at 02:55, xxxxxxxx wrote:

    It works without a problem here. My code:

      
    SplineObject *spline = static_cast<SplineObject*>(doc->GetActiveObject());  
      
    Vector *points = spline->GetPoint();  
      
    Vector p = Vector(0);  
      
    p = points[1];  
           
    Vector u = !p;  
      
    GePrint( RealToString(p.x) + " " + RealToString(p.y) + " " + RealToString(p.z) );  
    GePrint( RealToString(u.x) + " " + RealToString(u.y) + " " + RealToString(u.z) );  
    

    cheers,
    Matthias


Log in to reply