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
    The Maxon SDK Team is currently short staffed due to the winter holidays. No forum support is being provided between 15/12/2025 and 5/1/2026. For details see Maxon SDK 2025 Winter Holidays.

    Getting bounding box

    Scheduled Pinned Locked Moved SDK Help
    5 Posts 0 Posters 430 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 23/03/2005 at 14:49, xxxxxxxx wrote:

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

      ---------
      I need to get the bounding box of an object for a plugin Im writing. I know about the GetRad function, but that only give the radius of the bounding box. How can I use that to get the MIN and MAX vectors of the objects bounding box? What happens if the axis is off center? Sample code would be great! 🙂

      Matt

      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 23/03/2005 at 17:51, xxxxxxxx wrote:

        the GetRad function return a vector where x = width, y = heigth and z = depth. GetMp returns the bounding box center.

        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 24/03/2005 at 10:41, xxxxxxxx wrote:

          max = center+rad;
          min = center-rad;

          easy, isn´t it?! 🙂

          bounding box isec test? 😉

          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 24/03/2005 at 11:59, xxxxxxxx wrote:

            Ok, I got that. I didn't think about the midpoint thing. Im still new at this. Now that I have the bounding box, I am trying to shoot rays at the object to see where they collide. I am using the GeRayCollider functions (Intersect, etc) but it never intersects. I even hardcoded the start and direction vectors in to make sure it would intersect and still no go. What am I doing wrong?

              
            while (i<particles/3)  
            {  
                 rc->Intersect(Vector(0,300,0), Vector(0,1,0), 100000.0,false);  
                 GeRayColResult res;  
                 if (rc->GetNearestIntersection(&res;))  
                 {  
                      GePrint("Hit the object");  
                 }  
                 i=i+1;  
            }  
            
            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 24/03/2005 at 12:19, xxxxxxxx wrote:

              Nevermind. I gues the object in question needs to be a polygonal object? ALso, in the code I posted I had the direction vector pointed up instead of down. That was a typo. It seems to work now.

              Matt

              Thanks everyone!

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