About scaling very large Model to my wish size in OGRE

CPP_User

21-03-2008 03:43:35

I use 3DS Max 7 to export a model by ofusion plugin tools.
but the size(perhaps unit) is very lage,
I want get a small size.
In OGRe code, I use setScale function by pass a very small real num.
but no effect.
How can I do?
code as:
pTankeNode->setScale(0.00000000001,0.00000000001,0.00000000001);

Gormio

21-03-2008 15:22:23

I use 3DS Max 7 to export a model by ofusion plugin tools.
but the size(perhaps unit) is very lage,
I want get a small size.


IIRC at least when using the "unitless" mode of Max the values export as they are. When using e.g. meters the values are multiplied with 100. I don't have a Max at hand right now so I can't verify this. I apologize if I'm talking nonsense.

In OGRe code, I use setScale function by pass a very small real num.
but no effect.
How can I do?
code as:
pTankeNode->setScale(0.00000000001,0.00000000001,0.00000000001);


Those values seem so small that there might not be enough precision in floats. That effectively could set the scale to zero.

cpplover

22-03-2008 15:22:02

Yes,I have the same problem.

But what can I do?

Evak

22-03-2008 17:06:25

scale it in 3dsmax to the correct size and then reset the xforms and collapse. that will reset the units scale and you won't have to use the scale functions in ogre (almost always a bad idea to play with scale)

Lioric

22-03-2008 23:25:56

If you will be using the .mesh files manually in your project, reset the xform (or remove the scale by setting the current scale as the "unit scale", in the hierarchy tab), this will "bake" the vertices position in the mesh (using the current scale), if not then the vertices will be in a different position and the (node) scale will set them in the correct position (and you need the node and its data for this)

Scale can be used by nodes only, not by meshes, if you will be using the scene files then the loader will create the nodes for the meshes, and set the correct scale (in the nodes), but if you load the meshes directly (via create entity) the mesh will be used without any scale

As noted above, using scale in your application might introduce several issues if you are not handling it correctly, as lighting or animation issues, if there is no need to scale an object in your application, then export it as the "unit scale", with the methods mentioned in this thread