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

    COFFEE equivalent of...

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 375 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 18/04/2010 at 15:43, xxxxxxxx wrote:

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

      ---------
      This C++ code allows me to rotate an object explicitly around it's axis bands (strict local rotations)... it also moves the object along it's axis handles, but that's not part of the problem... it's just the rotations.  Here's the code:

        
                matRot=HPBToMatrix(vecRot);  //vecRot is the rotation transformation vector. Basically, the input  
                trans = trans ^ matRig;  //trans is the pos transformation vector, transformed into object's space  
                matRig.off = op->GetPos() +trans;     //trans added to the object... propulsion, basically.     
                matRig=matRig*matRot;  //transform rotation matrix into object's space  
                op->SetMg(matRig);  
        
      

      Is this possible in COFFEE?  The functions that are giving me the trouble are HPBToMatrix() and the multiplying of the 2 matrices in line 4.  How do I do those things in COFFEE?  I'll be honest, matrices have always confused me a bit;)

      In the past, I've used a child object to generate the rotation matrix (via xpresso), and the MoveObject() function posted by Mikael Sterner from years ago here.  [URL-REMOVED]But I'd like to be able to accomplish the rotations without the need for a child object.

      thanks,
      kvb


      [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

      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 19/04/2010 at 03:35, xxxxxxxx wrote:

        HPBToMatrix() is SetRotHPB()
        Matrix multiplication is done with GetMulM(), MulM_R() and MulM_L()

        cheers,
        Matthias

        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 19/04/2010 at 13:09, xxxxxxxx wrote:

          Thanks Matthias... again;)

          Here's the code that finally worked (turned out I was getting the matrices backwards when trying those functions before) :

            
          var objm = obj->GetMg();  
          var matRot = new(Matrix);  
          var vecRot = vector(0.01,0,0); //test values  
            
          matRot->SetRotHPB(vecRot);  
          matRot->MulM_L(objm);  
          obj->SetMg(matRot);  
          

          -kvb

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