Exemplo n.º 1
0
		private Triangle CreateTriangle(Point position, Vector direction)
		{
			direction.Normalize();
			direction *= vectorLength;

			Point p1 = position + 1.7 / 3 * direction;
			Point basePoint = position - 0.3333333 * direction;
			var perpendicular = direction.Perpendicular();
			perpendicular.Normalize();
			perpendicular *= 0.166666666666;
			Point p2 = basePoint + perpendicular;
			Point p3 = basePoint - perpendicular;

			Triangle triangle = trianglesPool.GetOrCreate();
			triangle.Point1 = new Point3D(p1.X, p1.Y, 0);
			triangle.Point2 = new Point3D(p2.X, p2.Y, 0);
			triangle.Point3 = new Point3D(p3.X, p3.Y, 0);
			return triangle;
		}