当前位置: 首页 > news >正文

湛江自助建站模板网站seo外链建设

湛江自助建站模板,网站seo外链建设,胶州专业建站,郑州有没有厉害的seo大坐标处理 CesiumUE总结 Cesium 首先想到的就是查看Cesium的代码看看他是怎么解决的对吧 这里有个最简代码片段,我们顺着往里找 * void main()* {* vec4 p czm_translateRelativeToEye(positionHigh, positionLow);* gl_Position czm_modelViewProjectionR…

大坐标处理

  • Cesium
  • UE
  • 总结

Cesium

首先想到的就是查看Cesium的代码看看他是怎么解决的对吧
这里有个最简代码片段,我们顺着往里找

* void main()* {*   vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);*   gl_Position = czm_modelViewProjectionRelativeToEye * p;* }
vec4 czm_translateRelativeToEye(vec3 high, vec3 low)
{vec3 highDifference = high - czm_encodedCameraPositionMCHigh;// This check handles the case when NaN values have gotten into `highDifference`.// Such a thing could happen on devices running iOS.if (length(highDifference) == 0.0) {  highDifference = vec3(0);  }vec3 lowDifference = low - czm_encodedCameraPositionMCLow;return vec4(highDifference + lowDifference, 1.0);
}

这里可以看见他把camera的坐标也传进来了,然后high low分别和camera的high low减一下再合并到一起,就得到了相对相机的坐标系

也就是说,他不仅把坐标拆成了high low,还减去了相机坐标,也就是减去相机之后的坐标还拆,这确实是能支持很大的数据了

czm_modelViewProjectionRelativeToEye 这个值的创建就是普通的modelViewMatirx只是把translate清空了,如下代码

czm_modelViewRelativeToEye: new AutomaticUniform({size: 1,datatype: WebGLConstants.FLOAT_MAT4,getValue: function (uniformState) {return uniformState.modelViewRelativeToEye;},
}),modelViewRelativeToEye: {get: function () {cleanModelViewRelativeToEye(this);return this._modelViewRelativeToEye;},}
function cleanModelViewRelativeToEye(uniformState) {if (uniformState._modelViewRelativeToEyeDirty) {uniformState._modelViewRelativeToEyeDirty = false;const mv = uniformState.modelView;const mvRte = uniformState._modelViewRelativeToEye;mvRte[0] = mv[0];mvRte[1] = mv[1];mvRte[2] = mv[2];mvRte[3] = mv[3];mvRte[4] = mv[4];mvRte[5] = mv[5];mvRte[6] = mv[6];mvRte[7] = mv[7];mvRte[8] = mv[8];mvRte[9] = mv[9];mvRte[10] = mv[10];mvRte[11] = mv[11];mvRte[12] = 0.0;mvRte[13] = 0.0;mvRte[14] = 0.0;mvRte[15] = mv[15];}
}

modelViewProjectionRelativeToEye只是一并在CPU做完几个乘法

modelViewProjectionRelativeToEye: {get: function () {cleanModelViewProjectionRelativeToEye(this);return this._modelViewProjectionRelativeToEye;},
},
function cleanModelViewProjectionRelativeToEye(uniformState) {if (uniformState._modelViewProjectionRelativeToEyeDirty) {uniformState._modelViewProjectionRelativeToEyeDirty = false;Matrix4.multiply(uniformState._projection,uniformState.modelViewRelativeToEye,uniformState._modelViewProjectionRelativeToEye,);}
}

这个是high low的解释
https://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm
这是Cesium里的实现

EncodedCartesian3.encode = function (value, result) {//>>includeStart('debug', pragmas.debug);Check.typeOf.number("value", value);//>>includeEnd('debug');if (!defined(result)) {result = {high: 0.0,low: 0.0,};}let doubleHigh;if (value >= 0.0) {doubleHigh = Math.floor(value / 65536.0) * 65536.0;result.high = doubleHigh;result.low = value - doubleHigh;} else {doubleHigh = Math.floor(-value / 65536.0) * 65536.0;result.high = -doubleHigh;result.low = value + doubleHigh;}return result;
};

这是CPP代码

void CDoubleToTwoFloats::Convert(double doubleValue,float& floatHigh, float& floatLow)
{if (doubleValue >= 0.0){double doubleHigh = floor(doubleValue / 65536.0) * 65536.0;floatHigh = (float)doubleHigh;floatLow = (float)(doubleValue - doubleHigh);}else{double doubleHigh = floor(-doubleValue / 65536.0) * 65536.0;floatHigh = (float)-doubleHigh;floatLow = (float)(doubleValue + doubleHigh);}
}

UE

https://dev.epicgames.com/documentation/en-us/unreal-engine/large-world-coordinates-rendering-in-unreal-engine-5
这里是UE的文档
之前就听说UE有这个支持,好奇他怎么搞的
这里是文档里最后一段话,看起来也是类似Cesium的解法
不过他还有一个空间,是纠正了旋转不只是减去offset,建议能做就做,那估计就是没做:)

FDFScalar(double Input)
{float High = (float)Input;float  Low = (float)(Input - High);
}

总结

这种做法每个坐标都需要存储两倍大小的坐标信息high low两个vector3,但是似乎如果要支持double的话,没有其他好法子

http://www.dtcms.com/a/530701.html

相关文章:

  • 上海住房城乡建设厅网站工程机械外贸网站建设
  • 佛山网站建设专业定制如何制作网络
  • 推广网站挣钱如何将数据写入wordpress文站
  • 网站如何留住客户长沙旅游商贸职业技术学院
  • 网站建设实验周志与总结一般多少钱做一个网站
  • 网站建设商业计划书ai免费logo设计一键生成
  • 网站建设技术服务公司怎么建一个公司运营网站
  • 青海省公路建设管理局官方网站东莞常平做网站公司
  • 盐城建设局网站中小型电子商务网站
  • 游戏界面设计网站贵阳手机银行app下载
  • 做封面的免费网站网站的建设主题
  • 个人网站免费域名注册安徽省招投标中心官网
  • 江苏中星建设集团网站虚拟产品货源网站
  • 网站手机客户端在线制作网站设计制作费
  • 员工入职 在哪个网站做招工汕头市广州新业建设有限公司网站
  • 白云品牌型网站建设山东省和城乡建设厅网站
  • 艺客网站首页怎么设置网址
  • 商务网站建设与运营陕西省城乡建设学校网站
  • aspcms 网站栏目管理网络工程师都考什么
  • 优秀门户网站欣赏深圳网站建设亿联时代
  • 公司做网站哪里做个人软件网站域名
  • 网站产品详情用哪个软件做的wordpress加速之gzip
  • 如何在局域网中做网站衡水高端网站建设
  • 泰通建设集团网站手机网站开发教程pdf
  • 福清建设银行网站南昌科技学院是几本大学
  • 医院网站建设技术方案如何查询网站打开速度变慢
  • 如何建立学校网站python cms系统
  • 淮北网站开发公司哈尔滨网络科技公司网站
  • 网站开发安全文档静态网站挂马
  • 安防行业网站建设方案论坛网站建设软件