Gamma has a simple solution for that.
Imagine you load a static model, for example a rock, and you want to have a corresponding tri-mesh, you just do that :
1 2 3 4 5 6 7 8
| Graphic3D rock = Model3DLoader.load("data/ARockModel.obj"); TriMeshGeom tmg = new TriMeshGeom(universe); rock.linkPosAndRot(tmg); tmg.adjustShape(rock); |
This provide a high level of abstraction : you don't mind if it's a OBJ, MD2, MD3, 3DS, Cal3D model.
If you have a moving animated object ( for example, a character ) that you want to represent physically with a box, you'll do that :
1 2 3 4 5 6 7 8 9 10
| Graphic3D character = Model3DLoader.load(universe, "data/MyCharacter.md2"); BoxGeom bg = new BoxGeom(universe); character.linkPosAndRot(bg); bg.linkShape(rock); PhysicalBehavior pB = new PhysicalBehavior(universe, bg); |
( However, I don't know if you had another project outside Gamma... )