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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Align object to a face

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 278 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 31/05/2006 at 01:23, xxxxxxxx wrote:

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

      ---------
      To simulate that an object is moving on a surface, I need to align an object to a face. I know collision point with the surface, and I get the normal of the found face, now I need to rotate the object according with the normal! This make me crazy, I'm new on vector math, and I can't find a way to do this!
      Can someone help me with an exhaustive example ?
      Thank's

      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 31/05/2006 at 03:36, xxxxxxxx wrote:

        The normal alone does not specify the rotation fully. You also need to specify a direction within the surface for the bank. Then the normal will be the Z azis and the chosen direction will be the X axis. The Y axis is Z % X, where % is the cross product.
        You can do these things directly in the object matrix. Just make sure that the vectors are normalized.

        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 31/05/2006 at 06:29, xxxxxxxx wrote:

          Thank's Mikael, I'll test it, I hope to have understood!

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