中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁 > news >正文

裝修網(wǎng)站建設(shè)策劃方案怎么做好推廣和營銷

裝修網(wǎng)站建設(shè)策劃方案,怎么做好推廣和營銷,如何作做網(wǎng)站,山東網(wǎng)頁制作網(wǎng)站Cesium 地球網(wǎng)格構(gòu)造 Cesium原理篇:3最長的一幀之地形(2:高度圖) HeightmapTessellator 用于從高程圖像創(chuàng)建網(wǎng)格。提供了一個(gè)函數(shù) computeVertices,可以根據(jù)高程圖像創(chuàng)建頂點(diǎn)數(shù)組。 該函數(shù)的參數(shù)包括高程圖像、高度數(shù)據(jù)的結(jié)構(gòu)、網(wǎng)格寬高、…

Cesium 地球網(wǎng)格構(gòu)造

Cesium原理篇:3最長的一幀之地形(2:高度圖)

請?zhí)砑訄D片描述

HeightmapTessellator

用于從高程圖像創(chuàng)建網(wǎng)格。提供了一個(gè)函數(shù) computeVertices,可以根據(jù)高程圖像創(chuàng)建頂點(diǎn)數(shù)組。

該函數(shù)的參數(shù)包括高程圖像、高度數(shù)據(jù)的結(jié)構(gòu)、網(wǎng)格寬高、邊緣裙板高度、矩形范圍、相機(jī)中心點(diǎn)等。函數(shù)的實(shí)現(xiàn)使用了許多性能優(yōu)化技巧,如將函數(shù)內(nèi)常量化、內(nèi)聯(lián)等。

該模塊的輸出為一個(gè)對象,包括創(chuàng)建好的頂點(diǎn)數(shù)組、最大與最小高度、該網(wǎng)格的邊界球、邊界方向盒等信息。

1、函數(shù)定義

// 聲明
static computeVertices(options) {}
// 使用
const width = 5;
const height = 5;
const statistics = Cesium.HeightmapTessellator.computeVertices({heightmap : [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0],width : width,height : height,skirtHeight : 0.0,nativeRectangle : {west : 10.0,east : 20.0,south : 30.0,north : 40.0}
});const encoding = statistics.encoding;
const position = encoding.decodePosition(statistics.vertices, index);

options 參數(shù):

參數(shù)類型描述
heightmapArray要鑲嵌的高度圖。
widthnumber高度圖的寬度(以高度樣本計(jì))。
heightnumber高度圖的高度(以高度樣本計(jì))。
skirtHeightnumber要懸垂在高度圖邊緣的裙子的高度。
nativeRectangleRectangle高度貼圖投影的原始坐標(biāo)中的矩形。對于具有地理投影的高度圖,這是度數(shù)。對于 Web 墨卡托投影,這是米。
exaggerationnumber用于夸大地形的比例尺。默認(rèn)為1.
exaggerationRelativeHeightnumber地形夸大的高度,以米為單位。默認(rèn)為0.
rectangleRectangle高度圖覆蓋的矩形,大地坐標(biāo)為北、南、東和西屬性(弧度)。必須提供矩形或本機(jī)矩形。如果同時(shí)提供兩者,則假定它們是一致的。
isGeographicboolean如果高度圖使用{@link GeographicProjection},則為true;如果使用{@link WebMercatorProjection},則為false。默認(rèn)為true。
relativeToCenterCartesian3將計(jì)算出的位置作為Cartesian3.subtract(worldPosition, relativeToCenter)。默認(rèn)為Cartesian3.ZERO。
ellipsoidEllipsoid高度貼圖適用的橢球體。默認(rèn)為Ellipsoid.WGS84。
structureobject描述高度數(shù)據(jù)結(jié)構(gòu)的對象。

裙邊(skirt)

防止不同層級mesh加載時(shí)出現(xiàn)裂縫

實(shí)現(xiàn)

  static computeVertices(options) {const cos = Math.cos;const sin = Math.sin;const sqrt = Math.sqrt;const toRadians = CesiumMath.toRadians;const heightmap = options.heightmap;const width = options.width;const height = options.height;const skirtHeight = options.skirtHeight;const hasSkirts = skirtHeight > 0.0;const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);const nativeRectangle = Rectangle.clone(options.nativeRectangle);const rectangle = Rectangle.clone(options.rectangle);const geographicWest = rectangle.west;const geographicSouth = rectangle.south;const geographicEast = rectangle.east;const geographicNorth = rectangle.north;const relativeToCenter = options.relativeToCenter;const includeWebMercatorT = defaultValue(options.includeWebMercatorT, false);const exaggeration = defaultValue(options.exaggeration, 1.0);const exaggerationRelativeHeight = defaultValue(options.exaggerationRelativeHeight,0.0);const hasExaggeration = exaggeration !== 1.0;const includeGeodeticSurfaceNormals = hasExaggeration;const rectangleWidth = Rectangle.computeWidth(nativeRectangle);const rectangleHeight = Rectangle.computeHeight(nativeRectangle);// 每個(gè)網(wǎng)格的長寬const granularityX = rectangleWidth / (width - 1);const granularityY = rectangleHeight / (height - 1);const radiiSquared = ellipsoid.radiiSquared;const radiiSquaredX = radiiSquared.x;const radiiSquaredY = radiiSquared.y;const radiiSquaredZ = radiiSquared.z;let minimumHeight = 65536.0;let maximumHeight = -65536.0;const fromENU = Transforms.eastNorthUpToFixedFrame(relativeToCenter,ellipsoid);const minimum = minimumScratch;minimum.x = Number.POSITIVE_INFINITY;minimum.y = Number.POSITIVE_INFINITY;minimum.z = Number.POSITIVE_INFINITY;const maximum = maximumScratch;maximum.x = Number.NEGATIVE_INFINITY;maximum.y = Number.NEGATIVE_INFINITY;maximum.z = Number.NEGATIVE_INFINITY;let hMin = Number.POSITIVE_INFINITY;const gridVertexCount = width * height;const edgeVertexCount = skirtHeight > 0.0 ? width * 2 + height * 2 : 0;const vertexCount = gridVertexCount + edgeVertexCount;const positions = new Array(vertexCount);const heights = new Array(vertexCount);const uvs = new Array(vertexCount);let startRow = 0;let endRow = height;let startCol = 0;let endCol = width;if (hasSkirts) {--startRow;++endRow;--startCol;++endCol;}for (let rowIndex = startRow; rowIndex < endRow; ++rowIndex) {let row = rowIndex;if (row < 0) {row = 0;}if (row >= height) {row = height - 1;}////  ^ latitude(緯度)//  |//  |              North(90)//  |              ---------//  |             |         |//  |  West(-180) |         | East(0)//  |             |         |//  |              ---------//  |              South(-90)//  -----------------------------> longitude(經(jīng)度)// 地理坐標(biāo)系下// 當(dāng)前緯度(latitude) 距離最北頭(North) 的距離// 這個(gè)值是越來越小的, 隨著行數(shù)越來越大let latitude = nativeRectangle.north - granularityY * row;latitude = toRadians(latitude);// 當(dāng)前緯度(latitude) 距離最南頭(South) 的百分比(0~1)let v = (latitude - geographicSouth) / (geographicNorth - geographicSouth);v = CesiumMath.clamp(v, 0.0, 1.0);const isNorthEdge = rowIndex === startRow;const isSouthEdge = rowIndex === endRow - 1;const cosLatitude = cos(latitude);const nZ = sin(latitude);const kZ = radiiSquaredZ * nZ;for (let colIndex = startCol; colIndex < endCol; ++colIndex) {let col = colIndex;if (col < 0) {col = 0;}if (col >= width) {col = width - 1;}const terrainOffset = row * width + col;let heightSample = heightmap[terrainOffset]let longitude = nativeRectangle.west + granularityX * col;longitude = toRadians(longitude);let u = (longitude - geographicWest) / (geographicEast - geographicWest);u = CesiumMath.clamp(u, 0.0, 1.0);let index = row * width + col;if (skirtHeight > 0.0) {const isWestEdge = colIndex === startCol;const isEastEdge = colIndex === endCol - 1;const isEdge = isNorthEdge || isSouthEdge || isWestEdge || isEastEdge;const isCorner = (isNorthEdge || isSouthEdge) && (isWestEdge || isEastEdge);if (isCorner) {// Don't generate skirts on the corners.continue;} else if (isEdge) {heightSample -= skirtHeight;if (isWestEdge) {// The outer loop iterates north to south but the indices are ordered south to north, hence the index flip below// 外循環(huán)從北到南迭代,但索引按從南到北的順序排列,因此索引在下面翻轉(zhuǎn)index = gridVertexCount + (height - row - 1);} else if (isSouthEdge) {// Add after west indices. South indices are ordered east to west.// 加在西方指數(shù)之后。南方指數(shù)是從東向西排列的。index = gridVertexCount + height + (width - col - 1);} else if (isEastEdge) {// Add after west and south indices. East indices are ordered north to south. The index is flipped like above.// 在西部和南部指數(shù)后加上。東部指數(shù)是從北向南排列的。索引如上所述翻轉(zhuǎn)。index = gridVertexCount + height + width + row;} else if (isNorthEdge) {// Add after west, south, and east indices. North indices are ordered west to east.// 在西部、南部和東部指數(shù)后添加。北方指數(shù)是從西向東排列的。index = gridVertexCount + height + width + height + col;}}}// 經(jīng)緯度轉(zhuǎn)笛卡爾坐標(biāo)系const nX = cosLatitude * cos(longitude);const nY = cosLatitude * sin(longitude);const kX = radiiSquaredX * nX;const kY = radiiSquaredY * nY;const gamma = sqrt(kX * nX + kY * nY + kZ * nZ);const oneOverGamma = 1.0 / gamma;const rSurfaceX = kX * oneOverGamma;const rSurfaceY = kY * oneOverGamma;const rSurfaceZ = kZ * oneOverGamma;const position = new Cartesian3();position.x = rSurfaceX + nX * heightSample;position.y = rSurfaceY + nY * heightSample;position.z = rSurfaceZ + nZ * heightSample;hMin = Math.min(hMin, heightSample);positions[index] = position;uvs[index] = new Cartesian2(u, v);heights[index] = heightSample;}}const aaBox = new AxisAlignedBoundingBox(minimum, maximum, relativeToCenter);const encoding = new TerrainEncoding(relativeToCenter,aaBox,hMin,maximumHeight,fromENU,false,includeWebMercatorT,includeGeodeticSurfaceNormals,exaggeration,exaggerationRelativeHeight);const vertices = new Float32Array(vertexCount * encoding.stride);let bufferIndex = 0;for (let j = 0; j < vertexCount; ++j) {bufferIndex = encoding.encode(vertices,bufferIndex,positions[j],uvs[j],heights[j],undefined,undefined,undefined);}return {vertices: vertices,};}
http://www.risenshineclean.com/news/11725.html

相關(guān)文章:

  • 企業(yè)網(wǎng)站推廣效果從哪些方面進(jìn)行分析網(wǎng)絡(luò)鏈接推廣
  • 鄭州做網(wǎng)站網(wǎng)站建設(shè)費(fèi)用企業(yè)營銷型網(wǎng)站建設(shè)
  • 網(wǎng)站開發(fā)能用react嗎恩施seo整站優(yōu)化哪家好
  • 張家界網(wǎng)站建設(shè)公司手游推廣個(gè)人合作平臺
  • 網(wǎng)站制作超鏈接怎么做淘寶代運(yùn)營靠譜嗎
  • 做外國購物網(wǎng)站需要交稅嗎百度首頁登錄入口
  • wordpress制作表單福州seo推廣外包
  • 學(xué)校網(wǎng)站建設(shè)申請網(wǎng)絡(luò)企業(yè)推廣
  • 酒仙網(wǎng)的網(wǎng)站推廣方式交換友情鏈接的平臺有哪些
  • 網(wǎng)站建設(shè)能用手機(jī)制作嗎網(wǎng)站鏈接分析工具
  • 網(wǎng)站域名空間怎么弄啊谷歌網(wǎng)頁版入口在線
  • 作網(wǎng)站網(wǎng)絡(luò)廣告推廣服務(wù)
  • 網(wǎng)站建設(shè)seo優(yōu)化推廣銷售網(wǎng)絡(luò)平臺推廣
  • 個(gè)人新聞類網(wǎng)站模板營銷策略包括哪些內(nèi)容
  • 有人看免費(fèi)的視頻嗎寧波網(wǎng)站seo診斷工具
  • 打開一張圖片后點(diǎn)擊跳轉(zhuǎn)到網(wǎng)站怎么做seo軟件視頻教程
  • asp.netc 動態(tài)網(wǎng)站開發(fā)網(wǎng)推項(xiàng)目
  • 廣州網(wǎng)絡(luò)推廣定制搜索引擎優(yōu)化seo公司
  • 燈飾網(wǎng)站開發(fā)seo哪個(gè)軟件好
  • 北京高端網(wǎng)站建設(shè)有限公司太原網(wǎng)站制作優(yōu)化seo
  • 做哪個(gè)網(wǎng)站賣一手房比較好培訓(xùn)課程安排
  • 用什么軟件做樓盤微網(wǎng)站廣州新塘網(wǎng)站seo優(yōu)化
  • 網(wǎng)站建設(shè)流程圖滿十八歲可以申請abc認(rèn)證嗎
  • 上市公司網(wǎng)站建設(shè)報(bào)價(jià)seo排名優(yōu)化
  • 網(wǎng)站建設(shè)圖片競價(jià)
  • 西安高端網(wǎng)站建設(shè)公司seo案例分析100例
  • 純靜態(tài)網(wǎng)站制作seo整站優(yōu)化報(bào)價(jià)
  • 一個(gè)網(wǎng)站的后臺怎么做太原網(wǎng)站建設(shè)
  • 百度怎樣做網(wǎng)站并宣傳網(wǎng)站長春網(wǎng)站建設(shè)公司哪家好
  • 鄭州婦科醫(yī)院正規(guī)有哪些廣州seo營銷培訓(xùn)