public override void Render() { GL.ClearColor(.7f, .9f, 1f, 1); // Clear the screen and the depth buffer GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); // // Setup Game World // GL.MatrixMode(MatrixMode.Modelview); GL.LoadIdentity(); //GL.Ortho(--ArenaUtils.glOrthoHalfWidth, ArenaUtils.glOrthoHalfWidth, // -ArenaUtils.glOrthoHalfHeight, ArenaUtils.glOrthoHalfHeight, // -ArenaUtils.glOrthoHalfWidth, ArenaUtils.glOrthoHalfWidth); GL.Ortho(-15, 15, -15, 15, -15, 15); GL.MatrixMode(MatrixMode.Projection); Matrix4 modelview = Matrix4.LookAt(Vector3.Zero, new Vector3(0f, 0f, -1f) /*Vector3.UnitZ*/, Vector3.UnitY); GL.LoadMatrix(ref modelview); GL.PushMatrix(); // Translate origin to center of arena for rotation GL.Rotate(cameraSpinRotation, 0, 1, 0); GL.Rotate(cameraOverheadRotation, 1, 0, 0); // // Draw entities // for (int i = 0; i < squareBoundedEntities.Length; i++) { SquareBoundedPhysicalEntity entity = squareBoundedEntities[i]; entity.DrawOpenGLDouble(); } for (int i = 0; i < circleBoundedEntities.Length; i++) { CircleBoundedPhysicalEntity entity = circleBoundedEntities[i]; entity.DrawOpenGLDouble(); } GL.PopMatrix(); }
static void Main() { CachingFactorizer factorizer = new CachingFactorizer(new BruteForcePrimeFactorizer()); /* * PhysicalEntity3D electron = new PhysicalEntity3D( * Sphere.Instance, new Rational(1), new Rational(1), new Location3D(1, 0, 0)); * * * PhysicalEntity3D nuetron = new PhysicalEntity3D( * Sphere.Instance, new Rational(20), new Rational(1), new Location3D( * */ SquareBoundedPhysicalEntity squareElection = new SquareBoundedPhysicalEntity( FactoredRational.One, SquareBoundedSquareArea.Instance, new Location2D(FactoredRational.Zero, FactoredRational.Zero), new FactoredRational(2, factorizer)); CircleBoundedPhysicalEntity circleElection1 = new CircleBoundedPhysicalEntity( FactoredRational.One, CircleBoundedCircleArea.Instance, new Location2D(new FactoredRational(3, factorizer), new FactoredRational(5, factorizer)), new FactoredRational(2, factorizer)); CircleBoundedPhysicalEntity circleElection2 = new CircleBoundedPhysicalEntity( FactoredRational.One, CircleBoundedCircleArea.Instance, new Location2D(new FactoredRational(-6, factorizer), new FactoredRational(-3, factorizer)), new FactoredRational(2, factorizer)); AISimulator simulator = new AISimulator( new SquareBoundedPhysicalEntity[] { squareElection }, new CircleBoundedPhysicalEntity[] { circleElection1, circleElection2, } ); simulator.CustomGameLoop(null); }