SCALE
My little test-group have been experienceing a lot of scaling problems when exporting from 3Dmax;
My GUI made it possible to rescale models quite easily before launch, but this was too hasselsome.
One of the main features I’ve gotten requests for is a verifiable 1:1 scaling.
-This by both architects and industrial design students.
After searching a bit on the osgART forum, I found out that the problem was this line:
modelScale.makeScale(sizeModel/bound.radius(),sizeModel/bound.radius(),sizeModel/bound.radius());
Apparently it makes the scale relative to a bounding-sphere, that has a variable size depending on the extents of the modelspace before export.
By reducing the sizeModel/bound.radius to sizeModel/100, i now have perfect scaleing in percentage, as long as the model is exported in units. Preferably set to mm.
TRANSLATION
In the same post on the osgART forum’ a user was also having another problem I’ve been experienceing.
When I export models in 1:1, no matter where in the grid they are placed, they do not always stay in their exported positions on the z-plane.
Turns out, once again this was due to the bounding-box;
modelTranslate.makeTranslate(-bound.center());
This automatically centered the model on the unitTransform in ARive. Since the center of a model is not at the level of the plane, the entire model is translated down -making rescaling difficult, since for every step in %-scaling, one had to move the model (seemingly on hunch) up or down the Z-axis.
The solution was to do the translation as follows:
modelTranslate.makeTranslate(-bound.center.x(), -bound.center.y(), 0);
Now everything should work out fine, and all objects should scale “upwards” from their base on the marker, making it easy to i.e. scale a building whithout seeing it move downward through the groundplane.
GUI
More bugs have been fixed, and the whole thing should run a bit smoother.
Also a lot of input I’ve got from VisKom has been implemented better (OK/CANCEL-button conventions et.c.)