我们目前正在使用以下算法来检测地理点是否位于复杂多边形内。这工作正常,除非多边形穿过 180\xc2\xb0 经线。
\n\n例如,在多边形中未检测到点 (-170, 60) 160,65,0 160,15,0 -160,15,0 -160,65,0 160,65,0
\n\n看下图:\n[Img]http://tinypic.com/r/14x2xl1[/img]\n我想要红框中的所有内容。不是黄盒子!
\n\n public static bool IsCoordinateInPolygon(IList<KMLCoordinate> polygon, KMLCoordinate testPoint)\n {\n\n bool result = false;\n int j = polygon.Count - 1;\n for (int i = 0; i < polygon.Count; i++)\n {\n if (polygon[i].Latitude < testPoint.Latitude && polygon[j].Latitude >= testPoint.Latitude || polygon[j].Latitude < testPoint.Latitude && polygon[i].Latitude >= testPoint.Latitude)\n {\n if (polygon[i].Longitude + (testPoint.Latitude - polygon[i].Latitude) / (polygon[j].Latitude - polygon[i].Latitude) * (polygon[j].Longitude - polygon[i].Longitude) < testPoint.Longitude)\n {\n result = !result;\n …Run Code Online (Sandbox Code Playgroud) 我正在尝试/理解图形管道中所需的所有基本数学计算,以从3D场景描述(如VRML)渲染简单的2D图像.是否有一个很好的示例所需的步骤,如模型转换(对象坐标到世界坐标),视图转换(从世界坐标到视图坐标),计算顶点法线用于照明,剪裁,计算视图内对象的屏幕坐标平截头体并创建2D投影以计算具有颜色的各个像素.