TriangleMesh Geometry

rewb0rn

25-02-2007 23:04:22

Hi!

At the moment im writing an object system to wrap all the ogreode classes. I want to create a trianglemesh geometry for an object like athene from ogre demo but the geometry doesnt fit the model. I have made a screenshot for this:


Is there a way to solve this without a Transform Geometry? You can see it works fine for SphereGeometry (and for BoxGeometry, too) so I wonder why it changes the position for a trianglemesh geometry...... (the position differ by the position node set for the object (which is used for the entity, the body and the geometry, so if i set the objects position to 0,0,0 the geometry and the model fit.)

Except the creation of the geometry all objects are totally created the same.

Here is some code.

SphereGeometry:

Geometry = static_cast<OgreOde::Geometry*>(new OgreOde::SphereGeometry(Radius, HardwareManager::Get()->GetSpace()));
if (!Geometry) return false;


TrimeshGeometry:

OgreOde::EntityInformer* EntityInformer = new OgreOde::EntityInformer(Entity, Position->_getFullTransform());
Geometry = EntityInformer->createStaticTriangleMesh(HardwareManager::Get()->GetSpace());

tuan kuranes

28-02-2007 13:41:03

and if you try without Position->_getFullTransform() ?

rewb0rn

28-02-2007 14:52:38

I made it, but its tricky. Thing is if you dont create a body for the entity and then create the geometry via entityinformer with full transform it works. if you create a body, it fits only if you dont use getfulltransform. I now just overrided the function for objects with body and it works.

tuan kuranes

28-02-2007 15:23:52

So, it works :
- static trimesh (no Body) + full Transform
- trimesh (Body) + no Full Transform

But then isn't that's basically what it's supposed to do ?
Perhaps some comments should make it more clear, perhaps ?

rewb0rn

28-02-2007 20:33:57

So, it works :
- static trimesh (no Body) + full Transform
- trimesh (Body) + no Full Transform

exactly, that means trimesh (body) + identity matrix (= no 2nd parameter)

Im not sure if this behaviour is correct, I just didnt know how to make it work, now I do, so I guess its ok the way it is. You just have to figure out how to do it once, if you dont, you run into trouble :)

tone

20-03-2007 14:04:15

What, exactly, does "static trimesh" mean?
That the mesh cannot be altered, geometrically?
That it cannot move?

Also, while OgreOde does not seem specific in this regard, can these TriMeshGeometries be non-convex?

I hope they can, as I intend to use simplified models of a ship model to act as simple wall+stair+deck+door colliders, and would love to punt on having to decompose the meshes into a set of convex meshes that together described the barriers and platforms for walking.

Thanks in advance.

tone

rewb0rn

20-03-2007 14:35:26

What, exactly, does "static trimesh" mean?
That the mesh cannot be altered, geometrically?
That it cannot move?
yes, like parts of the level basically, objects that have no body


Also, while OgreOde does not seem specific in this regard, can these TriMeshGeometries be non-convex?


I have not specifically tested, but we use bunches of models of all types, with wholes and stuff and it works all good.
Only collision between trianglemeshgeometries does not work that great, for testing i loaded athene from ogresdk and thats really bad behaviour, though it has many polys and it might get better when loading a simplified mesh for collision. collisions between the basic objects work good for now.