private void RotatePlanetoid( TexturedMeshObject mesh, Vector3 center, float angle) { Matrix world = mesh.World; world.M41 -= center.X; world.M42 -= center.Y; world.M43 -= center.Z; world = world * Matrix.CreateRotationZ( MathHelper.ToRadians(angle)); world.M41 += center.X; world.M42 += center.Y; world.M43 += center.Z; mesh.World = world; }
private void AddPlanetoidMesh(ref Matrix projection, Vector3 initial, string meshName) { Matrix world = Matrix.Identity; world = Matrix.CreateRotationX(MathHelper.ToRadians(90)) * world; world.M41 = initial.X; world.M42 = initial.Y; world.M43 = initial.Z; TexturedMeshObject mesh = new TexturedMeshObject(graphicsDevice, contentManager, meshName); mesh.World = world; mesh.Projection = projection; meshes.Add(mesh); }