/// <summary> /// Add a contour to the current polygon. /// </summary> /// <param name="contourVertices"> /// /// </param> public void AddContour(Vertex3d[] contourVertices, Vertex3d normal) { if (contourVertices == null) { throw new ArgumentNullException("contourVertices"); } MemoryLock countourLock = new MemoryLock(contourVertices); // Dispose later _CountourLocks.Add(countourLock); // Set to Vertex3d.Zero to compute automatically Glu.TessNormal(_Tess, normal.x, normal.x, normal.z); IntPtr vLockAddr = countourLock.Address; Glu.TessBeginContour(_Tess); foreach (Vertex3d v in contourVertices) { Glu.TessVertex(_Tess, vLockAddr, vLockAddr); vLockAddr = new IntPtr(vLockAddr.ToInt64() + 24); } Glu.TessEndContour(_Tess); }