Getting bounding box

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

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

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? 😉

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;  
}  

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!