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

    Translation along object's coordinates

    Scheduled Pinned Locked Moved SDK Help
    8 Posts 0 Posters 694 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 25/05/2008 at 00:05, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R9-R10.5 
      Platform:   Windows  ; Mac  ;  Mac OSX  ; 
      Language(s) :     C++  ;

      ---------
      This is a puzzling problem. I have a set of bones in a hierarchy. Each defines its coordinate system and should be translated along it in spite of its parent's coordinate system orientation. For instance, the parent system is rotated 45d about the X-axis but the object system has no rotation. When translated, the object should move along its system without consideration of its parent system.

      My thought is that there must be some retroactive compensation between the parent and object systems or that the parent system must be ignored during the object transformation somehow.

      As far as I know, this only involves rotated system relationships - i.e.: orientations. General rotations of the parent do affect the children objects.

      Any takers?

      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 26/05/2008 at 00:22, xxxxxxxx wrote:

        So you want the child object to be affected by the translation of the parent, but not by the rotation?

        Here is one way of "undoing" the rotation of a parent object:

        1. Get the parents normalized global matrix (Mgn). Let's call this matrix M.
        2. Set the translational part of M to zero, i.e. M.off=(0,0,0)
        3. Multiply the child objects global matrix by the inverse M.

        Hope this helps
        /Filip

        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 26/05/2008 at 08:58, xxxxxxxx wrote:

          No. The child needs to be affected by the rotation/translation but not the orientation of the parent object. My bone objects have an initial orientation of their coordinate system about which they rotate/translate - but it seems that children ignore this initial orientation of the parent and rotate/translate/scale along their own system. Children are still affected by the parent's rotations/translations but not the orientation.

          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 27/05/2008 at 03:08, xxxxxxxx wrote:

            Robert, I have difficulties to visualize your problem. Maybe you can post a picture or something that helps me to understand this better.

            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 27/05/2008 at 13:58, xxxxxxxx wrote:

              Here we go. 🙂

              Fig. 1: This shows the orientation of the head bone. The orientation is described by the rotation of the red/green crosshairs - 35.221d/0d/0d is the orientation (see below)

              Fig. 2: This shows the orientation of the lowerjaw - a child of the head. Orientation is 0d/0d/0d.

              Fig. 3: This shows the orientation settings of the head bone.

              Fig. 4: This shows the rotation of the head bone (0d/0d/0d).

              So, basically, there are two rotation sets on my plugin bones - orientation and rotation.

              Fig. 5: This is what happens when the lowerjaw bone is translated Y. Note that the mesh translates along the proper system (the lowerjaw system) but that the bone translates with respect to the orientation of the head bone which in turn causes the lowerjaw's children (the tongue parts) to translate incorrectly.

              Obviously, something that I'm doing to the matrix applied to the mesh (which is correct) isn't being done to the matrix applied to the bone. Unfortunately, the same matrix is not used between bone transformations and mesh deformations.

              The lowerjaw bone needs to move along an unrotated axis and not the oriented axis of the head. If the head is 'rotated', the lowerjaw bone needs to respond to this for obvious reasons.

              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 27/05/2008 at 15:39, xxxxxxxx wrote:

                Just thought I'd pop back in here to announce that it is solved. As expected, simply applying the parent's inverted orientation matrix to the translations of the child bone has worked.

                This is what I was trying to achieve:

                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 28/05/2008 at 00:18, xxxxxxxx wrote:

                  good to hear it's solved. so you are creating a human turtle generator plugin 😉

                  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 28/05/2008 at 09:09, xxxxxxxx wrote:

                    Yeah, that's it. 😉 This was just one of the instigators leading to realizing the problem - this pose (and others) applied to the original figure translates the jaws.

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