Пример #1
0
        private void ProjectPoly(MyPolygon input, MyPolygon output, ref Matrix projection)
        {
            for (int i = 0; i < input.LoopCount; ++i)
            {
                m_tmpList.Clear();

                var iterator = input.GetLoopIterator(i);
                while (iterator.MoveNext())
                {
                    Vector3 transformed = Vector3.Transform(iterator.Current, projection);
                    m_tmpList.Add(transformed);
                }

                output.AddLoop(m_tmpList);
            }
        }
Пример #2
0
 private MyPolygon UnprojectResult()
 {
     MyPolygon tmp = new MyPolygon(new Plane(Vector3.Forward, 0));
     MyPolygon result = new MyPolygon(m_projectionPlane);
     foreach (var poly in m_results)
     {
         poly.Postprocess();
         var loop = poly.GetLoop();
         if (loop.Count == 0) continue;
         tmp.AddLoop(poly.GetLoop());
     }
     ProjectPoly(tmp, result, ref m_invProjectionTransform);
     return result;
 }