world mesh

magura

13-03-2006 05:01:21

not talking NxOgre::world, more - how do i create a physical/graphical world?

I am using a carpark environment for the mobility scooter simulator im developing for a uni project, and currently i have my own object hierarchy for interactive objects (like the scooter itself, boxes, traffic cones etc). I drop these dynamic objects into a static physical/graphical world which I am building from a 3dsmax mesh file.

This doesnt seem to be the appropriate way of building an environment (although it works) - so, is there a better way to think of this problem or should I make myself an "editor". Also if I load a large static mesh like this, is it going to be a dramatic efficiency issue, or is this the sort of things that a scene manager takes care of? ie am I taking absolutely the least subtle path? heh

cheers,
Geoff

betajaen

13-03-2006 09:54:07

The same situation cropped up for myself when I started designing Eos (my game) that's why I invented NxScene.

What you do:

Model your world in Max as normal almost making it like an editor, then split it up into chunks, then make a note of the co-ordinates of each chunk. Write down the co-ordinates of all other objects in the scene too; Traffic cones, boxes,etc.

Then write a NxScene XML file to load them in.



<?xml version="1.0" encoding="utf-8"?>
<world>
<scene name="main" gravity="true" floor="true">

<material name="concrete" staticfriction="0.5" dynamicfriction="0.4" bounce="0" />

<body name="chunk1" position="345 1.235 64" mesh="nx.stairs1.mesh">
<shape type="mesh" mesh="chunk1.mesh" />
</body>
<body name="chunk2" position="-324 1.235 12" mesh="nx.stairs1.mesh">
<shape type="mesh" mesh="chunk2.mesh" />
</body>
<body name="chunk3" position="234 1.235 5" mesh="nx.stairs1.mesh">
<shape type="mesh" mesh="chunk3.mesh" />
</body>
</scene>
</world>



mWorld->createFromNxScene("myScene.nxscene",mSceneMgr);


More here: http://www.ogre3d.org/phpBB2/viewtopic.php?p=131175#131175

NxScene is new code though and can only be found in the CVS, there are some bits missing, such as Material Aliases (for multi-material meshShapes) and it doesn't support the prefab system or custom objects (i.e. your scooter) but you would load that in manually anyway.


Hope this helps!

[Edit]

The editor I designed called Corona, was meant to handle this sort of thing, but it only exists on a hard-disk in a box on a shelf at the moment, due to the broken PC. But Max should be even better!

magura

14-03-2006 12:59:24

so without me splitting it up, the scenemanager will just be a dummy and load the meshfile all up?

I'm not sure on how scenemanagers work tbh, and I'm just using them as a dummy myself :) At the moment - it just works with ST_GENERIC and is plenty fast enough (granted i havent tried on older computers).

I plan to model a static environment of a single level undercover carpark, complete with pillars and parked cars, pavements etc as static geometry (part of the world mesh file).

My (currently ungrounded, instinctive) fear is that as this world progresses its going to become more and more bogged down due to my lack of strategy here.

betajaen

14-03-2006 17:34:41

Unless you plan to use terrain, or anything like that most of the time it would be ST_GENERIC and NxOgre will work with any of them, as long as the interface is the same.

What I would do is this:-

Create the carpark as a full mesh, don't worry about UV mapping, but create it "simple" you use this as your collision model, with an empty entity.

createStaticBody("carpark","", new meshShape("carpark.collision.mesh" ...);

Then using your carpark as a base do all of your UV mapping, then load it as seperate meshes (carpark floor, walls, pillers, cars) etc.


I'd use NxScene then to load it in...

magura

14-03-2006 23:09:48

cool that sounds better