Something strange with the ogre units

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
oldfox
Halfling
Posts: 57
Joined: Mon Apr 18, 2005 5:46 pm

Something strange with the ogre units

Post by oldfox » Mon Apr 18, 2005 11:20 pm

I'm using the 3dMax Exporter (max R6), and I did a model of dimensions (0.3m,0.6m,0.3m) (units in my Max are in meters) , with the pivot at the center of mass.

Ok, the physical object in the physic Engine Novodex has the same size :(0.15,0.3,0.15) (you only precise half the size in Novodex engine)


I just draw the mesh at the center of mass of the physical object,so everything should be ok. I run the application, the mesh is exactly where it was supposed to be : standing on the ground.


But, when I start moving, movements are slow and small, has if the units weren't in meters....

I can see the same problem by changing the camera coordinates : I wanted to place it 2 meters up, so I just put it at (0,2,0), but as a result it was only at a few centimeters from the floor...



Why do the units in Ogre and the physic engine don't match?? I use meters in both representations, same dimensions, and the meshs are exported with Max working in meters... :oops:

I really don't get it!
0 x

User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
Contact:

Post by haffax » Mon Apr 18, 2005 11:32 pm

Ogre itself doesn't do anything to the units. A unit is a unit and nothing else. Maybe the exporter has a scaling option or sclaes without asking? Look into the mesh.xml at the vertex positions. Do they match with what you expect? (being in between -1.0 and 1.0 instead of like between -100.0 and 100.0)
0 x
team-pantheon programmer
creators of Rastullahs Lockenpracht

oldfox
Halfling
Posts: 57
Joined: Mon Apr 18, 2005 5:46 pm

Post by oldfox » Mon Apr 18, 2005 11:51 pm

Well, I just checked that and it seems exporter overides units settings :o


So I rescalled everything in 3dMax to have the right dimension in meters, and it now matches the xml file.

Ok, So in max I have the mesh standing on the groundplane.

In ogre, I import the mesh, and the mesh of the ground plane. And now it don't stand on the ground, it is in fact maybe 60cm over the ground...


I'm trying to find why :oops:
0 x

oldfox
Halfling
Posts: 57
Joined: Mon Apr 18, 2005 5:46 pm

Post by oldfox » Tue Apr 19, 2005 12:13 am

Hum and moving the pivot point, resetting transform matrix in 3dMax has no effext... And physic bouding box and mesh still don't match, don't understand how to ajust that... Anybody using max exporter?
0 x

User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7147
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 16

Post by Kojack » Tue Apr 19, 2005 3:02 am

I had problems with max exporting until I realised that changing the display units in max did nothing, you need to change the system units (a button on the display units panel) instead. At least that works with Octopus.
0 x

oldfox
Halfling
Posts: 57
Joined: Mon Apr 18, 2005 5:46 pm

Post by oldfox » Tue Apr 19, 2005 7:11 am

And what about the pivot point? How to place it where I want?
0 x

oldfox
Halfling
Posts: 57
Joined: Mon Apr 18, 2005 5:46 pm

Post by oldfox » Tue Apr 19, 2005 9:41 am

Ok I made some tests and found the problem : it is in fact the pivot point in the 3D mesh that don't match the center of mass of the physical object... Even if the coordinates of the mesh are ok, Ogre still put the pivot point on the bottom of the mesh instead of in the center...

I solve the matching problem by putting the center of mass of the object at his bottom, and now the mesh collide well with the ground, but of course the physical properties aren't good any more... :)

How to change the reference point in ogre, or how to make the exporter extracting the right pivot point set in 3D max ?
0 x

User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
Contact:

Post by haffax » Tue Apr 19, 2005 9:59 am

There is no pivot point in Ogre. You probably mean the origin of the local coordinate system. This is where the scene node is linked to when you attach the Entity to a SceneNode. Just move your mesh in Max so, that the origin of the global coordinate system is where you want the pivot point.
0 x
team-pantheon programmer
creators of Rastullahs Lockenpracht

oldfox
Halfling
Posts: 57
Joined: Mon Apr 18, 2005 5:46 pm

Post by oldfox » Tue Apr 19, 2005 11:27 am

Thanks! In fact I just have to set every mesh in Max with there pivot point at the origin.


One more problem solve :)
0 x

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
Contact:

Post by jacmoe » Tue Apr 19, 2005 5:49 pm

* thinking that this would be a nice addition to the exporting from max section on the ogre wiki *
0 x
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.

Post Reply