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

    Boundary box of rotated object

    SDK Help
    0
    2
    242
    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 07/10/2004 at 04:02, xxxxxxxx wrote:

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

      ---------
      Hi,

      I'm trying to find the boundary box of an object. To do this im using BaseObject::GetRad()
      That's works fine if the object isn't rotated.

      If for example I rotated a default cube by 45 degrees on the Pitch axis, the boundary box would be slightly larger than Vector(50,50,50)(which GetRad() returns).

      Will I have to calculate it myself?

      Thanks

      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 07/10/2004 at 05:23, xxxxxxxx wrote:

        To avoid to calculate yourself the bounding box, you could try something like this:

            
            
            
            
            // PSEUDOCODE
            
            
            
            
            1. Make a copy of the object global matrix (oldMtx = obj->GetMg())
            
            
            
            
            2. Assign an identity global matrix to the object (obj->SetMg(identity))
            
            
            
            
            3. Calculate the object bounding box (obj->GetRad())
            
            
            
            
            4. Reassign the original global matrix to the object (obj->SetMg(oldMtx))
            
            
            
        

        Hope it helps...

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