hi all ,
when we use getBoundingBox() function we get the values regarding it's x,y,z planes .... how do i access them .
thanks
getBoundingBox() --doubt
The bounding box just knows the min and max of the bounding area. It knows nothing about orientation. Well, it is always oriented with the coordinate system axes, so the orientation of the box is always the identity matrix.
In model space the planes are just this...
If you want that information in some other coordinate system, you need to apply the appropriate matrix transform to the plane.
It sounds like you may want the planes of the axis aligned box. If you want this, then you need to do no rotation, you just need to offset the plane position by half of the box extents.
In model space the planes are just this...
Code: Select all
core::plane3df xy(0, 0, 0, 0, 0, 1);
core::plane3df xz(0, 0, 0, 0, 1, 0);
core::plane3df yz(0, 0, 0, 1, 0, 0);
Code: Select all
// this would transform the above planes into world space
node->getAbsoluteTransformation().transformPlane(xy);
node->getAbsoluteTransformation().transformPlane(xz);
node->getAbsoluteTransformation().transformPlane(yz);
hi
is the following code not valid
// D3DRMBOX box;
core::aabbox3d<f32> Box;
//meshBuilder -> GetBox( &box );
Box=anode->getBoundingBox();
s32 sizex = Box.T maxx - Box.T minx;
s32 sizey = Box.T maxy - Box.T miny;
s32 sizez = Box.T maxz - Box.T minz;
// Find the average of the flyer's three dimensions.
size = ( sizex + sizey + sizez ) / 3.0;
thanks
hkolli
is the following code not valid
// D3DRMBOX box;
core::aabbox3d<f32> Box;
//meshBuilder -> GetBox( &box );
Box=anode->getBoundingBox();
s32 sizex = Box.T maxx - Box.T minx;
s32 sizey = Box.T maxy - Box.T miny;
s32 sizez = Box.T maxz - Box.T minz;
// Find the average of the flyer's three dimensions.
size = ( sizex + sizey + sizez ) / 3.0;
thanks
hkolli
Well, it would be simpler to say...
Code: Select all
core::vector3df size = node->getBoundingBox().getExtent();
// size.x, y and z are the dimensions of the box
core::vector3df center = node->getBoundingBox().getCenter();
// center.x, y and z mark the center of the bounding box