コード例 #1
0
ファイル: TerrainNode.cs プロジェクト: ukitake/Stratum
        /// <summary>
        /// Transforms the corners of this node to world space
        /// </summary>
        /// <returns></returns>
        protected virtual Vector3D[] transformCorners()
        {
            Vector3D[] transformed = new Vector3D[4];

            Vector3D[] cartesianCorners = corners.Select(latlon => RenderWGS84.ToWorld(latlon.Latitude, latlon.Longitude)).ToArray();
            for (int i = 0; i < cartesianCorners.Length; i++)
            {
                Vector3D normalized;
                Vector3D.Normalize(ref cartesianCorners[i], out normalized);
                transformed[i] = normalized * RenderWGS84.EarthRadius;
            }

            return(transformed);
        }