   Wall detection problem (Xna 3.1 & C# 2008 sp1)
  Hi everyone.I have problem with wall detection or objects collision detecting i have a character and a simple cube in my scene.My character will move toward if "CanMoveForward" be true.I check Collision detection by this method ://this._Model is my cube//c.Model ismy characterforeach (ModelMesh item1 in this._Model.Meshes){foreach (ModelMesh item2 in c.Model.Meshes){BoundingSphere b = item1.BoundingSphere.Transform(Matrix.CreateRotationY(x)*Matrix.CreateTranslation(this._Position) * item1.ParentBone.Transform);BoundingBox bb = BoundingBox.CreateFromSphere(b);BoundingSphere character = item2.BoundingSphere.Transform(c.GetWorld * item2.ParentBone.Transform);if (bb.Intersects(character)){c.CanMoveForward = false;return;}elsec.CanMoveForward = true;}}My problem is shown in this photo:http://www.imgplace.com/viewimg594/4600/56badcollisiondetection.jpgI have an idea for solve this problem.I want to create my own BoundingBox with 8 corners of my cube with this method BoundingBox.CreateFromPoints() but i dont know how i can get 8 corners of my cube.i tried this but have no success //this._Model is my cubethis._Model.Meshes[0].VertexBuffer.....Thanks for replies[Edited by - Saeed Masoumi on May 17, 2010 11:15:23 PM]
  Hi again.let me explain my problem in better way:I have a Cube (3d mesh created by 3d s max and exported to Cube.X) and i loaded it in my scene by this code:private Model model;public void LoadContent(){model=Content.Load<Model>("box1");}public void Draw(Camera Camera)   {  Matrix[] _Transforms = new Matrix[Model.Bones.Count];  Model.CopyAbsoluteBoneTransformsTo(_Transforms);  foreach (ModelMesh mesh in Model.Meshes)  { foreach (BasicEffect be in mesh.Effects) {be.EnableDefaultLighting();be.Projection = Camera.Projection;be.View = Camera.View;be.World = this.GetWorld * mesh.ParentBone.Transform; } mesh.Draw();  }   }Now this is my question:How can i get Coordinate of 8 corner of my cube?Thanks   ;  maybe this will help you out:http://forums.xna.com/forums/p/23499/127495.aspx   