private void BuildSolid() {
// Define 3D mesh object
MeshGeometry3D mesh = new MeshGeometry3D();
mesh.Positions.Add(new Point3D(-1, -1, 0.2));
//mesh.Normals.Add(new Vector3D(0, 0, 1));
mesh.Positions.Add(new Point3D(1, -1, 0.2));
//mesh.Normals.Add(new Vector3D(0, 0, 1));
mesh.Positions.Add(new Point3D(1, 1, 0.2));
//mesh.Normals.Add(new Vector3D(0, 0, 1));
mesh.Positions.Add(new Point3D(-1, 1, 0.2));
//mesh.Normals.Add(new Vector3D(0, 0, 1));
mesh.Positions.Add(new Point3D(-1, -1, -0.2));
//mesh.Normals.Add(new Vector3D(0, 0, -1));
mesh.Positions.Add(new Point3D(1, -1, -0.2));
//mesh.Normals.Add(new Vector3D(0, 0, -1));
mesh.Positions.Add(new Point3D(1, 1, -0.2));
//mesh.Normals.Add(new Vector3D(0, 0, -1));
mesh.Positions.Add(new Point3D(-1, 1, -0.2));
//mesh.Normals.Add(new Vector3D(0, 0, -1));
// Front face
mesh.TriangleIndices.Add(0);
mesh.TriangleIndices.Add(1);
mesh.TriangleIndices.Add(2);
mesh.TriangleIndices.Add(2);
mesh.TriangleIndices.Add(3);
mesh.TriangleIndices.Add(0);
// Back face
mesh.TriangleIndices.Add(6);
mesh.TriangleIndices.Add(5);
mesh.TriangleIndices.Add(4);
mesh.TriangleIndices.Add(4);
mesh.TriangleIndices.Add(7);
mesh.TriangleIndices.Add(6);
// Right face
mesh.TriangleIndices.Add(1);
mesh.TriangleIndices.Add(5);
mesh.TriangleIndices.Add(2);
mesh.TriangleIndices.Add(5);
mesh.TriangleIndices.Add(6);
mesh.TriangleIndices.Add(2);
// Top face
mesh.TriangleIndices.Add(2);
mesh.TriangleIndices.Add(6);
mesh.TriangleIndices.Add(3);
mesh.TriangleIndices.Add(3);
mesh.TriangleIndices.Add(6);
mesh.TriangleIndices.Add(7);
// Bottom face
mesh.TriangleIndices.Add(5);
mesh.TriangleIndices.Add(1);
mesh.TriangleIndices.Add(0);
mesh.TriangleIndices.Add(0);
mesh.TriangleIndices.Add(4);
mesh.TriangleIndices.Add(5);
// Right face
mesh.TriangleIndices.Add(4);
mesh.TriangleIndices.Add(0);
mesh.TriangleIndices.Add(3);
mesh.TriangleIndices.Add(3);
mesh.TriangleIndices.Add(7);
mesh.TriangleIndices.Add(4);
// Geometry creation
mGeometry = new GeometryModel3D(mesh, new DiffuseMaterial(Brushes.YellowGreen));
var tf = new Transform3DGroup();
mGeometry.Transform = tf;
a = new AxisAngleRotation3D(new Vector3D(0, 10, 0), 0);
tf.Children.Add(new RotateTransform3D(a));
var db=new DoubleAnimation(0,60,new Duration(TimeSpan.FromSeconds(10)));
db.RepeatBehavior=RepeatBehavior.Forever;
a.BeginAnimation(AxisAngleRotation3D.AngleProperty, db, HandoffBehavior.Compose);
group.Children.Add(mGeometry);
}