LuRenJia
07-11-2006 15:28:59
Hi!
I use maxscript to get the position of an Editable_Mesh after ResetXForm, code:
pt = selection[1].pos
format "% % %" pt.x pt.z -pt.y
I exported the mesh by oFusion, and found the position of the mesh is different with max object's
max: 5.52498,1592.09,-23875.4
oFusion: 2.16333 1606.19 -25102.1
How can I get the same result?
Thanks in adance!
yuriythebest
07-11-2006 15:43:01
try selecting the object, in pivot point settings choose "affect pivot only" and then click "center to object", export and compare
LuRenJia
07-11-2006 17:10:20
thanks yuriythebest.
unfortunately the result is different too. create a new max scene and place a simple box in it, ResetXForm and export the box as osm, I found the result is same. but in complex max scene, the result always is different even I follow as your saying.
max objects organized as hiberarchy, object may have a parent, I think the position of a object maybe related with its parent, but I am not sure.
yuriythebest
07-11-2006 18:15:36
hmm, strange- so in large max scenes with many objects positions of objects are exported incorrectly? How large is your scene? I'm working on my first ogre game, with the only geometry being 20 or so asteroids, a spaceship and a ufo- all of them are in the same scene and object position seems fine.
Are you exporting objects individually? if so I'm confused- if you use node->setPosition then the object should be exactly where you want it.
3ds max, just like ogre, organizes objects in a hirecracy, the only difference being that in 3ds max sceneNodes and meshes are one. However, both in ogre and 3ds max there is the Root, to which objects are linked, and to those objects you can attach other objects and so forth to form a hirecracy.
LuRenJia
08-11-2006 02:15:34
yes, I can correctly export my scene, the scene have more than 1000 objects and 201 materials

I will attach the objects according to which material be assigned. so finally there are only 201 objects.
oFusion is a very good tool, but I need more flexibility, such as export Forest object infomation and create billboards from that. now I export the data using maxscript and create billboards successfully, but the position is not correct.
yuriythebest
08-11-2006 07:20:44
uhuh, so this is a maxscript->oFusion incompatibility? What about the position of the objects in oFusion preview?
hmmm, are you sure your doing it right, I am making a kind of cad tool at the moment for some patented blocks, and were having no problem with ofusion. So long as we build the models correctly and reset the xform before laying everything out all is good.
We have scenes with up to 6000 meshes, and can load an OSM into our app containing entire buildings made of seperate blocks, and replace the blocks in the OSM with our rigged blocks with snapping features etc.
Could you post a picture demonstrating your problem?
Here's a house comprized of about 4000 meshes loaded as an OSM with instances.
LuRenJia
08-11-2006 10:19:15
thank your replies.
great screenshot! the gui is very very good.
all of meshes exported by oFusion looks right and good in my ogre App. the problem is the position of billboards exported by my maxscript is not correct. maybe can't say "incorrect", just not match oFusion's.
I tried some different max scenes, compare the result of oFusion with my maxscript. sometimes is same and else not.
yuriythebest
08-11-2006 15:15:05
Evak- that is one weird house

great looking tool
with billboards one of the axis of the local pivot is used to determine where the mesh rotates around. In max this would be Z whilst in a game engine it would normaly be Y so you may have to rotate the local pivot to either Y or -Y as vertical and then reset the xform.
The house is a plan for a african house using something a bit like lego but used in real life to build housing out of agricultural waste in 3rd world countries. Getting all those blocks to render at speed is proving difficult since modern GPU's don't like lots of tiny batches

and currently we have up to 6000 blocks in a building with child helper nodes used for things like snapping.
PS. were going to make an OSM editor for our blitzmax wrapper after we finish this project. It should be useful for anyone that uses OSM since you can load multiple OSM files move entities and change materials then save out a new scene.
Lioric
09-11-2006 01:29:04
Nice image Evak, your application keeps getting better on each screenshot, excellent job