/// <summary> /// And last but not least the whole point of the whole application- perform a frame of the animation /// showing the polyhedron rotating while opening or closing /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void animationTimer_Completed(object sender, EventArgs e) { if (_net == null) { return; } Vector2 pivot = _net.Root.Center; Polyhedron polyhedron = PolyhedronBuilder.Build(_net, clip(_howClosed, 0, 1)); int n = polyhedron.Faces.Count; Projector.Project(polyhedron, _yaw, new Vector3(pivot.X, 0f, pivot.Y), (n <= 20) ? ((n <= 8) ? 1.6f : 1.2f) : 1.0f, this.Animation); _yaw += _yawDelta; _howClosed += _howClosedDelta; if (_howClosed > 1.0f) { _howClosedDelta = +_howClosedDelta; } /*else if (_howClosed < -0.2f) * { * _howClosedDelta = -_howClosedDelta; * if (this.Cycling) * { * int i = (this.currentPolyhedronIndex + this._polyhedrons.Length - 1) % this._polyhedrons.Length; * this.CurrentPolyhedronId = this._polyhedrons[i]; * } * }*/ this.animationTimer.Begin(); }
private void AddObjectToScene() { _scene.AddObject( PolyhedronBuilder.CreatePolyhedron( _currenPolyhedronType, new HomogeneousPoint3D(0, 0, 0, 1), new HomogeneousPoint3D(0, 0, 0, 1), A)); }
private void InitializeMultipleObjectsScene() { IPolyhedron3D polyhedron = PolyhedronBuilder.CreatePolyhedron( _currenPolyhedronType, new HomogeneousPoint3D(0, 0, 0, 1), new HomogeneousPoint3D(0, 0, 0, 1), A); _scene = new MultipleObjectsScene(new HomogeneousPoint3D(0, 0, -600, 1), polyhedron, 400); }