Exemplo n.º 1
0
 void CastRays()
 {
     const float noiseAmount = 0.01f;
     MockPoint mp = new MockPoint(_scaleVec);
     Ray ray;
     RaycastHit hit;
     List<Vector3> pointsList = new List<Vector3>();
     Vector3 pos;
     for (float i = 0f; i <= 1f; i += RaySpacing)
     {
         for (float j = 0f; j <= 1f; j += RaySpacing)
         {
             ray = _rayCam.ViewportPointToRay(new Vector3(i, j, 0));
             if (Physics.Raycast(ray, out hit))
             {
                 pos = MockPoint.AddNoise(hit.point, noiseAmount);
                 if (CreateSpheres)
                     mp.CreateSphereAtPos(pos);
                 if (WriteToFile)
                     pointsList.Add(pos);
             }
         }
     }
     if (WriteToFile)
     {
         pointsList = ProcessPoints.Process(pointsList);
         WritePoints.Write(pointsList, " ", 50);
     }
 }
        public void process_point_into_web_mercator_projection_expect_x_and_y()
        {
            var point = new MockPoint(GeometryType.Point, 40.73064d, -73.99044d, 0d);
            var webMercatorProcessor = new WebMercatorProcessor(point);

            Assert.AreEqual(0.294471d, webMercatorProcessor.ProjectedX);
            Assert.AreEqual(0.375915411794357d, webMercatorProcessor.ProjectedY);
        }