[Solved] (yet another) Scaling problem.

gbisocoli

17-12-2011 20:25:11

Hi, I'm creating a soccer enviroment, this are some sizes/masses/etc. :

Player (soccer player standard, a cube for now):
bodyDescription.mMass = 80.0f; // Set the mass to 80kg.
mBody = mRenderSystem->createBody(NxOgre::BoxDescription(55,175,30), [...] //width: 0.50, height: 1.75, depth:0.30
Body->getNode()->setScale(10);


Ball (Official)
bodyDescription.mMass = 0.45f; // 450 gr
NxOgre::SphereDescription sphere;
sphere.mRadius= 11.14;
mBody->getNode()->setScale(0.1114);


This way, Ogre and NxOgre actors are the same sizes and all are in scale with the other actors.

The problem is that it all appears to be huge, because when the 'players' appear from above the ground they fall really slow to the ground, so what would be the correct Ogre/NxOgre sizes or scale for the actors to be at 'normal' size? I'm kind of lost here so I hope you understand what I mean.

saejox

17-12-2011 23:10:20

1 unit in nxogre is 1 meter.
an 175*10 unit player is 1750 meters (god damn huge, more than a mile long). considering your gravity is -9.8 (earth gravity), your player's fall speed will be very slow relative to his size.

solution
use realistic values
NxOgre::BoxDescription(0.55,1.75,0.3) for player
dont scale it unless you know what your are doing.

gbisocoli

19-12-2011 19:59:38

Thanks, I understand now :) I corrected all the sizes and now it's all ok.

Why do you say that I should not scale? If I don't scale the Ogre ball is huge compared to the NxOgre Ball, do you say it's better to make a mesh of the exact size? I'm using "sphere.mesh". I'm planning to use OgreProcedural in the future to make all the 'meshes' (Ball, Goal, etc...).

saejox

19-12-2011 20:31:35

Thanks, I understand now :) I corrected all the sizes and now it's all ok.

Why do you say that I should not scale? If I don't scale the Ogre ball is huge compared to the NxOgre Ball, do you say it's better to make a mesh of the exact size? I'm using "sphere.mesh". I'm planning to use OgreProcedural in the future to make all the 'meshes' (Ball, Goal, etc...).


use ogremeshmagick.exe from ogrecommandline tools to scale your meshes beforehand. there is a wiki page explaining how to scale *.mesh files.

gbisocoli

19-12-2011 20:38:50

Ok, thanks, I'm going to try that.