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

    Bounding box after point manipulation [SOLVED]

    SDK Help
    0
    3
    279
    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

      On 09/03/2015 at 13:41, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   14,15,16 
      Platform:      
      Language(s) :     C++  ;

      ---------
      Hi,

      Let's say that I have a polygonal object and I scaled its points without changing the object matrix. As a result, the bounding box is not affected by the scaling, and the object is unselectable outside the original bounding box (before the scaling).

      My question is how do I update the bounding box after the point scaling. I cannot scale the object matrix because I am doing some intricate point manipulation and not just scaling.

      I figured I would use MinMax, but I don't know how to apply it to the object.

      MinMax mm;
      const Vector *pPoints = ToPoint(op)->GetPointR();
      LONG i, numPoints = ToPoint(op)->GetPointCount();
      mm.Init();
      for(i=0; i<numPoints; i++)
      {
      	mm.AddPoint(*pPoints);
              pPoints++;
      }
      

      Now how do I make use of mm to update the bounding box of my polygonal object?

      Thanks

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

        On 09/03/2015 at 13:53, xxxxxxxx wrote:

        Regarding the unselectability, you should send MSG_UPDATE after you
        are done making changes to the object via its Message() method.

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

          On 09/03/2015 at 14:14, xxxxxxxx wrote:

          Thanks Niklas. That did the trick, and updated the bounding box as well.

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