Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    Oriented Bounding Box

    SDK Help
    0
    6
    649
    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
      Helper
      last edited by

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

      On 25/05/2003 at 10:07, xxxxxxxx wrote:

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

      ---------
      Is there any in-built routine to calculate if the oriented Bounding Boxes of two objects intersect?
      With oriented bounding boxes I mean the bounding boxes that are around the objects when they are oriented by 0,0,0 but that are rotated when the object is rotated too. Is this clear? 😉
      Thank you very much in advance.

      Rui Batista

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

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

        On 25/05/2003 at 13:43, xxxxxxxx wrote:

        No. (And especially not in C.O.F.F.E.E... 😉

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

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

          On 26/05/2003 at 03:14, xxxxxxxx wrote:

          Ok, back to my net search 😞
          By the way, when will COFFEE get an overhaul?

          Rui Batista

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

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

            On 16/09/2004 at 19:03, xxxxxxxx wrote:

            I'd like to hear the answer to that one myself Rui.  Anybody?

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

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

              On 17/09/2004 at 06:55, xxxxxxxx wrote:

              Answer:

              Take the object/hierarchy points (GetPointCount() and GetPoints()) and determine the default Bounding Box. The points retrieved from objects are not transformed and therefore represent the untransformed object.

              Once you have the Bounding Box points, use object->GetMg() and apply it to its points (assuming the use of a PointObject for the Bounding Box) :

                
              var mat = object->GetMg();  
              for (i = 0; i < 8; i++)  
              bndBox->SetPoint(i) = mat->GetMulP(bndBox->GetPoint(i));  
              

              This will transform the points to be oriented similarly to the object.

              Then perform intersection tests as usual. General 3D intersection tests are somewhat complicated (as compared to axis-aligned bounding box ones). You will need to test for volume-volume intersection. Check out Graphics Gems and Game Programming Gems for solutions.

              Robert

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

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

                On 17/09/2004 at 09:00, xxxxxxxx wrote:

                Addendum:

                Just thought to mention that if you only calculate an axis-aligned bounding box on the objects' transformed points (using Mg), you can use the simple method of intersection testing, at least a first elimination test. This method quickly eliminates objects that in no way intersect.

                It is just a matter of determining the 'minimum' and 'maximum' values on each axis (XYZ), and testing thusly:

                if ((obj1minX < obj2minX) && (obj1maxX < obj2minX)) // no intersection
                else if ((obj1minX > obj2maxX) && (obj1maxX > obj2maxX)) // no intersection
                else if ((obj1minY < obj2minY) && (obj1maxY < obj2minY)) // no intersection
                else if ((obj1minY > obj2maxY) && (obj1maxY > obj2maxY)) // no intersection
                else if ((obj1minZ < obj2minZ) && (obj1maxZ < obj2minZ)) // no intersection
                else if ((obj1minZ > obj2maxZ) && (obj1maxZ > obj2maxZ)) // no intersection

                // otherwise there is a possible intersection - definite bounding box intersection

                Robert

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