Following basicsetupdemo, i'm using :
//Create a physical environment from a triangle mesh.
//First, collect the the mesh data from the model using a helper function.
//This special kind of vertex inherits from the TriangleMeshVertex and optionally includes
//friction/bounciness data.
//The StaticTriangleGroup requires that this special vertex type is used in lieu of a normal TriangleMeshVertex array.
Vector3[] vertices;
int[] indices;
TriangleMesh.GetVerticesAndIndicesFromModel(FireLevelModel, out vertices, out indices);
//Give the mesh information to a new StaticMesh.
//Give it a transformation which scoots it down below the kinematic box entity we created earlier.
var mesh = new StaticMesh(vertices, indices, new AffineTransform(new Vector3(0, -10, 0)));
mesh.Tag = "level";
//Add it to the space!
myGame.Space.Add(mesh);
//Make it visible too.
myGame.Components.Add(new StaticModel(FireLevelModel, mesh.WorldTransform.Matrix, myGame));
The mesh doesn't appear. However, it is there (because my character lands on it with gravity). Why is this happening? It used to work but now i'm trying to integrate it with a menu class then this problem appears.
Staticmesh level not drawn
Re: Staticmesh level not drawn
That appears to be a purely graphical issue, so there's better places to get assistance than here. My guess would be something to do with the spritebatch and renderstates if it starts happening when a menu is involved.
Re: Staticmesh level not drawn
Other model files ( my skinned animation ) works fine. Are there any other ways to display the staticmesh? I dont see any issues with the render state or spritebatch.. but i could be wrong. I'm using the game state manager from http://create.msdn.com/en-US/education/ ... management to do the menu system. Now i'm just placing that paragraph of codes into their gameplayscreen.cs . Everything else works except the mesh :/
Re: Staticmesh level not drawn
Graphically, there is nothing special about the mesh. It's a bunch of vertices and indices; you can draw it however you'd like.