I am creating a program in WindowsForms and Xna that allows users to create a 3D room. By dragging and customizing different .fbx models, they can "build" a room or whatever and then look at it in 3D. Everything worked nicely so far, until I got to a point that involves scaling a model. A model is usually made up of multiple meshes, and each mesh has a class that contains information about that mesh such as, position, rotation, name, mesh, scaleFactor, etc. This class also contains a list called ScalableAxes which contains strings of the axes name, in which this mesh can be scaled.
I have also included a parent-child relationship, when a user imports a .fbx model, there is also a custom .pdn file which contains information about parenting. Usually every mesh in the .fbx model becomes a child of an "empty mesh" (just a class, with no mesh or bone assigned to it).
Now let's say this "empty mesh" name is Body and it contains few child meshes such as left side, right side, top side, bottom side, top door, bottom door. Let's say I scale Body on the Y axis by a factor of 2. Since Body has no Mesh in his class assigned, it would skip this and loop through his children. If a child has a mesh, then it would look to ScalableAxes list and if it contains Y (in this case) it would go on to the scaling part.
The problem starts here. Let's say I come to Left side, left side can be scaled on the Y axis, but the top and bottom sides CAN'T be scaled on the Y axis. So scaling it this way would lead to gaps between left side and top and *bottom side**. Also there can be a whole variety of different models, and meshes. For example: one has only one door, other has sides between top and bottom, and so on...
EDIT: For example: left side is 964 on Y axis, top and bottom side are each 18 on Y axis, so the combined length is 1000 on Y axis. I scale the whole Body by 2 on the Y axis (meaning the new Y size should be 1000 * 2 = 2000). If I were to use scaling by 2 on the Y axis on all meshes (that can be scaled on the Y axis), then left side would be 1928, top and bottom would stay the same so, 18 each on Y axis. This would lead to 1928+18+18, 1964 size on the Y axis instead of 2000.
EDIT2: This program is all about arranging / making furniture in 3D. So let's say you got this night stand in your project made with this program.
And you find the size of it to small, and you want to scale it vertically. When you would scale it the "thickness" of all of the elements (meshes that made up this model) should stay the same since you want to make it bigger not "thicker". Only the length and width should change. So the left and right side would get scaled vertically, but top and bottom side wouldn't since that vertical direction is their "thickness". And if you would want to scale the model horizontally (make it wider), the top and bottom sides would get scaled, but left and right would stay the same since that direction is their "thickness" (they would only have to get moved to the right positions).
Thats why in my previous picture I said that top and bottom side cant be scaled on the Y axis, since that was their "thickness".
EDIT 3: bummzack, your method works great and all, but what if I have a furniture that has, 3 or more doors. How would I be able to scale all of the doors equally?
Any help is greatly appreciated!