Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login

    spline alignment issue

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 352 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

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

      On 15/04/2005 at 09:09, xxxxxxxx wrote:

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

      ---------
      Hello all.
      I'm trying to align an object to a spline.
      All works great as long as the spline's axis is aligned to it's parent's axis.

      I know I'm missing something obvious, but if someone feels like nudging me in the right direction it would be much appreciated.

      Here's what I've got:

        
      vPosition = splineObj->GetSplinePoint(splinePos, 0, NULL);  
      vTangent = splineObj->GetSplineTangent(splinePos, 0, NULL);  
        
      m.off = vPosition;  
      m.v3 = vTangent;  
      m.v2 = Vector(0,1,0);  
      m.v1 = m.v3 % m.v2;  
      m.v2 = m.v3 % m.v1;  
        
      op->SetMg(m);  
      

      -chris

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

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

        On 21/04/2005 at 13:35, xxxxxxxx wrote:

        Do "op->SetMg(splineObj->GetMg() * m)" to convert m, which is currently expressed in local coordinates of the spline, to world coordinates.

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

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

          On 21/04/2005 at 14:40, xxxxxxxx wrote:

          Thanks Mikael... I knew it was something simple....

          -chris

          1 Reply Last reply Reply Quote 0
          • First post
            Last post