Help with loading model files
Posted: Sun Dec 19, 2010 7:20 pm
Hello,
I just started trying out this physics engine and have had no problem getting the built-in Box type to render. The problem for me comes when trying to load in a simple box model I have made in Blender. When I run the program I get an exception on the following line:
StaticTriangleGroup.StaticTriangleGroupVertex[] vertices;
int[] indices;
StaticTriangleGroup.GetVerticesAndIndicesFromModel(boxModel, out vertices, out indices);
var mesh = new TriangleMesh(vertices, indices);
mesh.WorldMatrix = Matrix.CreateTranslation(new Vector3(0, 0, 0));
var group = new StaticTriangleGroup(mesh);
game.gameSpace.Add(group);
game.modelDrawer.Add(mesh);
The exception is Unsupported vertex type in mesh. I'm not really sure what is happening. The cube model is about as simple as it gets! Any help would be appreciated so I can better understand loading custom models. Thanks!
I just started trying out this physics engine and have had no problem getting the built-in Box type to render. The problem for me comes when trying to load in a simple box model I have made in Blender. When I run the program I get an exception on the following line:
StaticTriangleGroup.StaticTriangleGroupVertex[] vertices;
int[] indices;
StaticTriangleGroup.GetVerticesAndIndicesFromModel(boxModel, out vertices, out indices);
var mesh = new TriangleMesh(vertices, indices);
mesh.WorldMatrix = Matrix.CreateTranslation(new Vector3(0, 0, 0));
var group = new StaticTriangleGroup(mesh);
game.gameSpace.Add(group);
game.modelDrawer.Add(mesh);
The exception is Unsupported vertex type in mesh. I'm not really sure what is happening. The cube model is about as simple as it gets! Any help would be appreciated so I can better understand loading custom models. Thanks!