Relative sizes and positions of nodes?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
powerpop
Posts: 171
Joined: Thu Jan 08, 2004 1:39 am
Location: san francisco

Relative sizes and positions of nodes?

Post by powerpop »

I have a cube.obj that was saved with vertices at 512x512x512. When i place two of these onscreen i offset them by 512 in the x direction so that they should be next to each other exactly. But onscreen I notice that the second cube is VERY far away from the first.

When I load a mesh how is it mapped to world coordinates (in size)?

I guess in general I am wondering how i set up my world so that my objects are imported at the right scale (every object is 512x512x512 or some multiple of that size) - the player character will be slightly bigger than 128 high - and my objects will be placed on a 512 grid so they "snap" together.
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Post by saigumi »

It depends on where the model is in relation to it's center.

Irrlicht puts X + Z center in the center and the Y's zero at zero.

In my milkshape models, I put the model in the center of the X and Z and put the bottom of the feet at Y = 0. One milkshape unit = One Irrlicht Unit at a 1/1/1 scale, I don't know about any other model package.

So, if you cube is at exact center, placing the block the width of the block across is correct.
Crud, how do I do this again?
powerpop
Posts: 171
Joined: Thu Jan 08, 2004 1:39 am
Location: san francisco

Post by powerpop »

that's what i thought - i have a maya obj converted from a .cob file - the vertex numbers look right - but when i place two cubes they are extremely far apart - when they should only be 512 apart (next to each other) - hmmm, i wonder if the obj importer normalizes all the vertex numbers down to 1,1,1 irrlicht units??? - could i send you my cube.obj for you to check (just for my own sanity)?

my email addy is popomatix at yahoo dot com
Boogle
Posts: 162
Joined: Fri Nov 21, 2003 3:16 pm
Location: Toronto, Canada

Post by Boogle »

I use obj files and they work for me (not normalized or anything), however it took some doing to get this to work through Maya. When I finished my model I had to place it at actual 0,0,0 in Maya (not 0,0,0 according to the object, which is sometimes off, especially after doing boolean operations), then use the freeze transformations option to get the scaling back to normal. If you know of an easier way, let me know, but Maya (at least Maya 5) seems to have issues with keeping consistent measurements.
powerpop
Posts: 171
Joined: Thu Jan 08, 2004 1:39 am
Location: san francisco

Post by powerpop »

the obj looks fine when i place it at 0,0,0 near the camera - when i place the second one at 512,0,0 it is very far off - this is what is puzzling - it doesnt look like a maya problem
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

I think it is a problem of the .obj exporter. I also saw these problems. It can be avoided by doing exactly what Boogle said.
powerpop
Posts: 171
Joined: Thu Jan 08, 2004 1:39 am
Location: san francisco

Post by powerpop »

any chance of a 4.3 sub release so i can get my little hands on the .x importer?! i would like to standardize my objects on that format

seems like an odd effect to be an obj exporter problem - even if the origin is way off i still would not expect the cube to be so far away when set at 512 in the x - only if the scaling was way off - and it does not seem to have a scaling problem

i'll try some other converters to see if i can fix it
powerpop
Posts: 171
Joined: Thu Jan 08, 2004 1:39 am
Location: san francisco

Post by powerpop »

aha! - so it was the converter after all - the conversion multiplied all the vertices by 0.100 so the cube was a lot smaller than 512 - i corrected that and have then joining nicely - i guess i couldnt tell because the first cube was so close to the player cam that it looked huge - and the intermediate file (a .cob) had the right vertice numbers - and maya obj is in hex which is ... hard to read

thanks for all the help! i hope to have something good to show soon!
Post Reply