it is something I don t understand on transforming (meshes). Please take a look at my code (which is in Render() function) first:
foreach (GeometricObject obj in this.objects)
{
if (obj != this.activeObject)
{
obj.Mesh = MeshUtils.ChangeMeshColor(obj.Mesh, Color.Yellow, device);
}
else
{
obj.Mesh = MeshUtils.ChangeMeshColor(obj.Mesh, Color.Green, device);
obj.GeometryMatrix.Translate(this.move);
}
device.Transform.World = obj.GeometryMatrix;
obj.Mesh.DrawSubset(0);
}
Explanation: I have got some yellow gometriObjects (meshes) and one green activeObject (I can switch between them by keyboard 1-4). move is a vector that I change after every arrow is selected on keyboard (so I can move the active objects).
BUT it is not working as I wanted to. ...if I change the position of one of my objects...then after switching to the other (changing activeObject) I got the other view on the screen (after all switches ... all objects are in the same place of the screen;/). Why is that it isn t the same view for all the time? I think...it should, because I have got the same view setted:
device.Transform.View = Matrix.LookAtLH(new Vector3(0.0f, 2.0f, -25.0f), // Camera position
new Vector3(0.0f, 0.0f, 0.0f), // Look-at point
new Vector3(0.0f, 1.0f, 0.0f)); // Up vector
So what s my problem? Any ideas:)? Aha...the problem isn t connected with that changingMeshColor function...i checked.