Good day.
I really need you help, cause few days cant find a solution.
So I got an object-container, where I put 2 similar .fbx models. Here is a structure
[38240-exs.png*_|38240]
Models has beed prepared in 3DsMax.
In my project I need to find exact size of “window_small(Clone)”. I am using that script
meshfilterArray = gameObject.GetComponentsInChildren<MeshFilter>();
meshArray = new Mesh[meshfilterArray.Length];
boundsArray = new Bounds[meshfilterArray.Length];
for (int i = 0; i < meshfilterArray.Length; i++)
{
meshArray_ = meshfilterArray*.mesh;*_
boundsArray_ = meshfilterArray*.mesh.bounds;
}*_
Bounds totalBound = new Bounds();
for (int i = 0; i < boundsArray.Length; i++)
{
Bounds bound = boundsArray*;*
MeshFilter mf = meshfilterArray*;*
float scale = mf.transform.localScale.x;
Bounds b = new Bounds( bound.center * scale,bound.size * scale);
totalBound.Encapsulate(b);
}
But in a fact, I get boundaries like that (yellow is Boundary box draw by script)
![alt text][2]
Why it is happening? How to ix it?
*
*[2]: http://puu.sh/e8mUl/758194ba91.png*_