区块链技术博客
www.b2bchain.cn

Cesium 雷达扫描方式、圆扩算求职学习资料

本文介绍了Cesium 雷达扫描方式、圆扩算求职学习资料,有助于帮助完成毕业设计以及求职,是一篇很好的资料。

对技术面试,学习经验等有一些体会,在此分享。

注本代码都是函数,需要有最基本、基础的知识才能看懂
// 调用改函数即可
function addRadarScan(viewer,data){
viewer.scene.globe.depthTestAgainstTerrain = true; //防止移动、放大缩小会视觉偏移depthTestAgainstTerrain // 设置该属性为true之后,标绘将位于地形的顶部;如果设为false(默认值),那么标绘将位于平面上。缺陷:开启该属性有可能在切换图层时会引发标绘消失的bug。
var CartographicCenter = new Cesium.Cartographic(Cesium.Math.toRadians(data.lon), Cesium.Math.toRadians(data.lat),0); //中心位子
return AddRadarScanPostStage(viewer, CartographicCenter,data.r,data.scanColor,data.interval);
}
/**
*圆形扩大扫描圈,cartographicCenter中心点, maxRadius最大半径, scanColor扫描颜色, duration持续时间
* */
function AddCircleScanPostStage(viewer, cartographicCenter, maxRadius, scanColor, duration) {
var ScanSegmentShader =
“uniform sampler2D colorTexture;n” +
“uniform sampler2D depthTexture;n” +
“varying vec2 v_textureCoordinates;n” +
“uniform vec4 u_scanCenterEC;n” +
“uniform vec3 u_scanPlaneNormalEC;n” +
“uniform float u_radius;n” +
“uniform vec4 u_scanColor;n” +
“vec4 toEye(in vec2 uv, in float depth)n” +
” {n” +
” vec2 xy = vec2((uv.x * 2.0 – 1.0),(uv.y * 2.0 – 1.0));n” +
” vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);n” +
” posInCamera =posInCamera / posInCamera.w;n” +
” return posInCamera;n” +
” }n” +
“vec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point)n” +
“{n” +
“vec3 v01 = point -planeOrigin;n” +
“float d = dot(planeNormal, v01) ;n” +
“return (point – planeNormal * d);n” +
“}n” +
“float getDepth(in vec4 depth)n” +
“{n” +
“float z_window = czm_unpackDepth(depth);n” +
“z_window = czm_reverseLogDepth(z_window);n” +
“float n_range = czm_depthRange.near;n” +
“float f_range = czm_depthRange.far;n” +
“return (2.0 * z_window – n_range – f_range) / (f_range – n_range);n” +
“}n” +
“void main()n” +
“{n” +
“gl_FragColor = texture2D(colorTexture, v_textureCoordinates);n” +
“float depth = getDepth( texture2D(depthTexture, v_textureCoordinates));n” +
“vec4 viewPos = toEye(v_textureCoordinates, depth);n” +
“vec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);n” +
“float dis = length(prjOnPlane.xyz – u_scanCenterEC.xyz);n” +
“if(dis < u_radius)n” +
“{n” +
“float f = 1.0 -abs(u_radius – dis) / u_radius;n” +
“f = pow(f, 4.0);n” +
“gl_FragColor = mix(gl_FragColor, u_scanColor, f);n” +
“}n” +
“}n”;

    var _Cartesian3Center = Cesium.Cartographic.toCartesian(cartographicCenter);     var _Cartesian4Center = new Cesium.Cartesian4(_Cartesian3Center.x, _Cartesian3Center.y, _Cartesian3Center.z, 1);     var _CartographicCenter1 = new Cesium.Cartographic(cartographicCenter.longitude, cartographicCenter.latitude, cartographicCenter.height + 500);     var _Cartesian3Center1 = Cesium.Cartographic.toCartesian(_CartographicCenter1);     var _Cartesian4Center1 = new Cesium.Cartesian4(_Cartesian3Center1.x, _Cartesian3Center1.y, _Cartesian3Center1.z, 1);     var _time = (new Date()).getTime();     var _scratchCartesian4Center = new Cesium.Cartesian4();     var _scratchCartesian4Center1 = new Cesium.Cartesian4();     var _scratchCartesian3Normal = new Cesium.Cartesian3();     var ScanPostStage = new Cesium.PostProcessStage({         fragmentShader: ScanSegmentShader,         uniforms: {             u_scanCenterEC: function () {                 return Cesium.Matrix4.multiplyByVector(viewer.camera._viewMatrix, _Cartesian4Center, _scratchCartesian4Center);             },             u_scanPlaneNormalEC: function () {                 var temp = Cesium.Matrix4.multiplyByVector(viewer.camera._viewMatrix, _Cartesian4Center, _scratchCartesian4Center);                 var temp1 = Cesium.Matrix4.multiplyByVector(viewer.camera._viewMatrix, _Cartesian4Center1, _scratchCartesian4Center1);                 _scratchCartesian3Normal.x = temp1.x - temp.x;                 _scratchCartesian3Normal.y = temp1.y - temp.y;                 _scratchCartesian3Normal.z = temp1.z - temp.z;                 Cesium.Cartesian3.normalize(_scratchCartesian3Normal, _scratchCartesian3Normal);                 return _scratchCartesian3Normal;              },             u_radius: function () {                 return maxRadius * (((new Date()).getTime() - _time) % duration) / duration;             },             u_scanColor: scanColor         }     });     viewer.scene.postProcessStages.add(ScanPostStage);     return (ScanPostStage);  } function addCircleScan(viewer,data){     viewer.scene.globe.depthTestAgainstTerrain = true; //防止移动、放大缩小会视觉偏移depthTestAgainstTerrain // 设置该属性为true之后,标绘将位于地形的顶部;如果设为false(默认值),那么标绘将位于平面上。缺陷:开启该属性有可能在切换图层时会引发标绘消失的bug。     var CartographicCenter = new Cesium.Cartographic(Cesium.Math.toRadians(data.lon), Cesium.Math.toRadians(data.lat), 0); //中心位子     return  AddCircleScanPostStage(viewer, CartographicCenter,data.r,data.scanColor,data.interval); }  /**  *区域雷达扫描,,cartographicCenter中心点, maxRadius最大半径, scanColor扫描颜色, duration持续时间  * */ function AddRadarScanPostStage(viewer, cartographicCenter, radius, scanColor, duration) {     var ScanSegmentShader =         "uniform sampler2D colorTexture;n" +         "uniform sampler2D depthTexture;n" +         "varying vec2 v_textureCoordinates;n" +         "uniform vec4 u_scanCenterEC;n" +         "uniform vec3 u_scanPlaneNormalEC;n" +         "uniform vec3 u_scanLineNormalEC;n" +         "uniform float u_radius;n" +         "uniform vec4 u_scanColor;n" +         "vec4 toEye(in vec2 uv, in float depth)n" +         " {n" +         " vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));n" +         " vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);n" +         " posInCamera =posInCamera / posInCamera.w;n" +         " return posInCamera;n" +         " }n" +         "bool isPointOnLineRight(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt)n" +         "{n" +         "vec3 v01 = testPt - ptOnLine;n" +         "normalize(v01);n" +         "vec3 temp = cross(v01, lineNormal);n" +         "float d = dot(temp, u_scanPlaneNormalEC);n" +         "return d > 0.5;n" +         "}n" +         "vec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point)n" +         "{n" +         "vec3 v01 = point -planeOrigin;n" +         "float d = dot(planeNormal, v01) ;n" +         "return (point - planeNormal * d);n" +         "}n" +         "float distancePointToLine(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt)n" +         "{n" +         "vec3 tempPt = pointProjectOnPlane(lineNormal, ptOnLine, testPt);n" +         "return length(tempPt - ptOnLine);n" +         "}n" +         "float getDepth(in vec4 depth)n" +         "{n" +         "float z_window = czm_unpackDepth(depth);n" +         "z_window = czm_reverseLogDepth(z_window);n" +         "float n_range = czm_depthRange.near;n" +         "float f_range = czm_depthRange.far;n" +         "return (2.0 * z_window - n_range - f_range) / (f_range - n_range);n" +         "}n" +         "void main()n" +         "{n" +

注本代码都是函数,需要有最基本、基础的知识才能看懂
// 调用改函数即可
function addRadarScan(viewer,data){
viewer.scene.globe.depthTestAgainstTerrain = true; //防止移动、放大缩小会视觉偏移depthTestAgainstTerrain // 设置该属性为true之后,标绘将位于地形的顶部;如果设为false(默认值),那么标绘将位于平面上。缺陷:开启该属性有可能在切换图层时会引发标绘消失的bug。
var CartographicCenter = new Cesium.Cartographic(Cesium.Math.toRadians(data.lon), Cesium.Math.toRadians(data.lat),0); //中心位子
return AddRadarScanPostStage(viewer, CartographicCenter,data.r,data.scanColor,data.interval);
}
/**
*圆形扩大扫描圈,cartographicCenter中心点, maxRadius最大半径, scanColor扫描颜色, duration持续时间
* */
function AddCircleScanPostStage(viewer, cartographicCenter, maxRadius, scanColor, duration) {
var ScanSegmentShader =
“uniform sampler2D colorTexture;n” +
“uniform sampler2D depthTexture;n” +
“varying vec2 v_textureCoordinates;n” +
“uniform vec4 u_scanCenterEC;n” +
“uniform vec3 u_scanPlaneNormalEC;n” +
“uniform float u_radius;n” +
“uniform vec4 u_scanColor;n” +
“vec4 toEye(in vec2 uv, in float depth)n” +
” {n” +
” vec2 xy = vec2((uv.x * 2.0 – 1.0),(uv.y * 2.0 – 1.0));n” +
” vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);n” +
” posInCamera =posInCamera / posInCamera.w;n” +
” return posInCamera;n” +
” }n” +
“vec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point)n” +
“{n” +
“vec3 v01 = point -planeOrigin;n” +
“float d = dot(planeNormal, v01) ;n” +
“return (point – planeNormal * d);n” +
“}n” +
“float getDepth(in vec4 depth)n” +
“{n” +
“float z_window = czm_unpackDepth(depth);n” +
“z_window = czm_reverseLogDepth(z_window);n” +
“float n_range = czm_depthRange.near;n” +
“float f_range = czm_depthRange.far;n” +
“return (2.0 * z_window – n_range – f_range) / (f_range – n_range);n” +
“}n” +
“void main()n” +
“{n” +
“gl_FragColor = texture2D(colorTexture, v_textureCoordinates);n” +
“float depth = getDepth( texture2D(depthTexture, v_textureCoordinates));n” +
“vec4 viewPos = toEye(v_textureCoordinates, depth);n” +
“vec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);n” +
“float dis = length(prjOnPlane.xyz – u_scanCenterEC.xyz);n” +
“if(dis < u_radius)n” +
“{n” +
“float f = 1.0 -abs(u_radius – dis) / u_radius;n” +
“f = pow(f, 4.0);n” +
“gl_FragColor = mix(gl_FragColor, u_scanColor, f);n” +
“}n” +
“}n”;

    var _Cartesian3Center = Cesium.Cartographic.toCartesian(cartographicCenter);     var _Cartesian4Center = new Cesium.Cartesian4(_Cartesian3Center.x, _Cartesian3Center.y, _Cartesian3Center.z, 1);     var _CartographicCenter1 = new Cesium.Cartographic(cartographicCenter.longitude, cartographicCenter.latitude, cartographicCenter.height + 500);     var _Cartesian3Center1 = Cesium.Cartographic.toCartesian(_CartographicCenter1);     var _Cartesian4Center1 = new Cesium.Cartesian4(_Cartesian3Center1.x, _Cartesian3Center1.y, _Cartesian3Center1.z, 1);     var _time = (new Date()).getTime();     var _scratchCartesian4Center = new Cesium.Cartesian4();     var _scratchCartesian4Center1 = new Cesium.Cartesian4();     var _scratchCartesian3Normal = new Cesium.Cartesian3();     var ScanPostStage = new Cesium.PostProcessStage({         fragmentShader: ScanSegmentShader,         uniforms: {             u_scanCenterEC: function () {                 return Cesium.Matrix4.multiplyByVector(viewer.camera._viewMatrix, _Cartesian4Center, _scratchCartesian4Center);             },             u_scanPlaneNormalEC: function () {                 var temp = Cesium.Matrix4.multiplyByVector(viewer.camera._viewMatrix, _Cartesian4Center, _scratchCartesian4Center);                 var temp1 = Cesium.Matrix4.multiplyByVector(viewer.camera._viewMatrix, _Cartesian4Center1, _scratchCartesian4Center1);                 _scratchCartesian3Normal.x = temp1.x - temp.x;                 _scratchCartesian3Normal.y = temp1.y - temp.y;                 _scratchCartesian3Normal.z = temp1.z - temp.z;                 Cesium.Cartesian3.normalize(_scratchCartesian3Normal, _scratchCartesian3Normal);                 return _scratchCartesian3Normal;              },             u_radius: function () {                 return maxRadius * (((new Date()).getTime() - _time) % duration) / duration;             },             u_scanColor: scanColor         }     });     viewer.scene.postProcessStages.add(ScanPostStage);     return (ScanPostStage);  } function addCircleScan(viewer,data){     viewer.scene.globe.depthTestAgainstTerrain = true; //防止移动、放大缩小会视觉偏移depthTestAgainstTerrain // 设置该属性为true之后,标绘将位于地形的顶部;如果设为false(默认值),那么标绘将位于平面上。缺陷:开启该属性有可能在切换图层时会引发标绘消失的bug。     var CartographicCenter = new Cesium.Cartographic(Cesium.Math.toRadians(data.lon), Cesium.Math.toRadians(data.lat), 0); //中心位子     return  AddCircleScanPostStage(viewer, CartographicCenter,data.r,data.scanColor,data.interval); }  /**  *区域雷达扫描,,cartographicCenter中心点, maxRadius最大半径, scanColor扫描颜色, duration持续时间  * */ function AddRadarScanPostStage(viewer, cartographicCenter, radius, scanColor, duration) {     var ScanSegmentShader =         "uniform sampler2D colorTexture;n" +         "uniform sampler2D depthTexture;n" +         "varying vec2 v_textureCoordinates;n" +         "uniform vec4 u_scanCenterEC;n" +         "uniform vec3 u_scanPlaneNormalEC;n" +         "uniform vec3 u_scanLineNormalEC;n" +         "uniform float u_radius;n" +         "uniform vec4 u_scanColor;n" +         "vec4 toEye(in vec2 uv, in float depth)n" +         " {n" +         " vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));n" +         " vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);n" +         " posInCamera =posInCamera / posInCamera.w;n" +         " return posInCamera;n" +         " }n" +         "bool isPointOnLineRight(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt)n" +         "{n" +         "vec3 v01 = testPt - ptOnLine;n" +         "normalize(v01);n" +         "vec3 temp = cross(v01, lineNormal);n" +         "float d = dot(temp, u_scanPlaneNormalEC);n" +         "return d > 0.5;n" +         "}n" +         "vec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point)n" +         "{n" +         "vec3 v01 = point -planeOrigin;n" +         "float d = dot(planeNormal, v01) ;n" +         "return (point - planeNormal * d);n" +         "}n" +         "float distancePointToLine(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt)n" +         "{n" +         "vec3 tempPt = pointProjectOnPlane(lineNormal, ptOnLine, testPt);n" +         "return length(tempPt - ptOnLine);n" +         "}n" +         "float getDepth(in vec4 depth)n" +         "{n" +         "float z_window = czm_unpackDepth(depth);n" +         "z_window = czm_reverseLogDepth(z_window);n" +         "float n_range = czm_depthRange.near;n" +         "float f_range = czm_depthRange.far;n" +         "return (2.0 * z_window - n_range - f_range) / (f_range - n_range);n" +         "}n" +         "void main()n" +         "{n" +

注本代码都是函数,需要有最基本、基础的知识才能看懂
// 调用改函数即可
function addRadarScan(viewer,data){
viewer.scene.globe.depthTestAgainstTerrain = true; //防止移动、放大缩小会视觉偏移depthTestAgainstTerrain // 设置该属性为true之后,标绘将位于地形的顶部;如果设为false(默认值),那么标绘将位于平面上。缺陷:开启该属性有可能在切换图层时会引发标绘消失的bug。
var CartographicCenter = new Cesium.Cartographic(Cesium.Math.toRadians(data.lon), Cesium.Math.toRadians(data.lat),0); //中心位子
return AddRadarScanPostStage(viewer, CartographicCenter,data.r,data.scanColor,data.interval);
}
/**
*圆形扩大扫描圈,cartographicCenter中心点, maxRadius最大半径, scanColor扫描颜色, duration持续时间
* */
function AddCircleScanPostStage(viewer, cartographicCenter, maxRadius, scanColor, duration) {
var ScanSegmentShader =
“uniform sampler2D colorTexture;n” +
“uniform sampler2D depthTexture;n” +
“varying vec2 v_textureCoordinates;n” +
“uniform vec4 u_scanCenterEC;n” +
“uniform vec3 u_scanPlaneNormalEC;n” +
“uniform float u_radius;n” +
“uniform vec4 u_scanColor;n” +
“vec4 toEye(in vec2 uv, in float depth)n” +
” {n” +
” vec2 xy = vec2((uv.x * 2.0 – 1.0),(uv.y * 2.0 – 1.0));n” +
” vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);n” +
” posInCamera =posInCamera / posInCamera.w;n” +
” return posInCamera;n” +
” }n” +
“vec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point)n” +
“{n” +
“vec3 v01 = point -planeOrigin;n” +
“float d = dot(planeNormal, v01) ;n” +
“return (point – planeNormal * d);n” +
“}n” +
“float getDepth(in vec4 depth)n” +
“{n” +
“float z_window = czm_unpackDepth(depth);n” +
“z_window = czm_reverseLogDepth(z_window);n” +
“float n_range = czm_depthRange.near;n” +
“float f_range = czm_depthRange.far;n” +
“return (2.0 * z_window – n_range – f_range) / (f_range – n_range);n” +
“}n” +
“void main()n” +
“{n” +
“gl_FragColor = texture2D(colorTexture, v_textureCoordinates);n” +
“float depth = getDepth( texture2D(depthTexture, v_textureCoordinates));n” +
“vec4 viewPos = toEye(v_textureCoordinates, depth);n” +
“vec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);n” +
“float dis = length(prjOnPlane.xyz – u_scanCenterEC.xyz);n” +
“if(dis < u_radius)n” +
“{n” +
“float f = 1.0 -abs(u_radius – dis) / u_radius;n” +
“f = pow(f, 4.0);n” +
“gl_FragColor = mix(gl_FragColor, u_scanColor, f);n” +
“}n” +
“}n”;

    var _Cartesian3Center = Cesium.Cartographic.toCartesian(cartographicCenter);     var _Cartesian4Center = new Cesium.Cartesian4(_Cartesian3Center.x, _Cartesian3Center.y, _Cartesian3Center.z, 1);     var _CartographicCenter1 = new Cesium.Cartographic(cartographicCenter.longitude, cartographicCenter.latitude, cartographicCenter.height + 500);     var _Cartesian3Center1 = Cesium.Cartographic.toCartesian(_CartographicCenter1);     var _Cartesian4Center1 = new Cesium.Cartesian4(_Cartesian3Center1.x, _Cartesian3Center1.y, _Cartesian3Center1.z, 1);     var _time = (new Date()).getTime();     var _scratchCartesian4Center = new Cesium.Cartesian4();     var _scratchCartesian4Center1 = new Cesium.Cartesian4();     var _scratchCartesian3Normal = new Cesium.Cartesian3();     var ScanPostStage = new Cesium.PostProcessStage({         fragmentShader: ScanSegmentShader,         uniforms: {             u_scanCenterEC: function () {                 return Cesium.Matrix4.multiplyByVector(viewer.camera._viewMatrix, _Cartesian4Center, _scratchCartesian4Center);             },             u_scanPlaneNormalEC: function () {                 var temp = Cesium.Matrix4.multiplyByVector(viewer.camera._viewMatrix, _Cartesian4Center, _scratchCartesian4Center);                 var temp1 = Cesium.Matrix4.multiplyByVector(viewer.camera._viewMatrix, _Cartesian4Center1, _scratchCartesian4Center1);                 _scratchCartesian3Normal.x = temp1.x - temp.x;                 _scratchCartesian3Normal.y = temp1.y - temp.y;                 _scratchCartesian3Normal.z = temp1.z - temp.z;                 Cesium.Cartesian3.normalize(_scratchCartesian3Normal, _scratchCartesian3Normal);                 return _scratchCartesian3Normal;              },             u_radius: function () {                 return maxRadius * (((new Date()).getTime() - _time) % duration) / duration;             },             u_scanColor: scanColor         }     });     viewer.scene.postProcessStages.add(ScanPostStage);     return (ScanPostStage);  } function addCircleScan(viewer,data){     viewer.scene.globe.depthTestAgainstTerrain = true; //防止移动、放大缩小会视觉偏移depthTestAgainstTerrain // 设置该属性为true之后,标绘将位于地形的顶部;如果设为false(默认值),那么标绘将位于平面上。缺陷:开启该属性有可能在切换图层时会引发标绘消失的bug。     var CartographicCenter = new Cesium.Cartographic(Cesium.Math.toRadians(data.lon), Cesium.Math.toRadians(data.lat), 0); //中心位子     return  AddCircleScanPostStage(viewer, CartographicCenter,data.r,data.scanColor,data.interval); }  /**  *区域雷达扫描,,cartographicCenter中心点, maxRadius最大半径, scanColor扫描颜色, duration持续时间  * */ function AddRadarScanPostStage(viewer, cartographicCenter, radius, scanColor, duration) {     var ScanSegmentShader =         "uniform sampler2D colorTexture;n" +         "uniform sampler2D depthTexture;n" +         "varying vec2 v_textureCoordinates;n" +         "uniform vec4 u_scanCenterEC;n" +         "uniform vec3 u_scanPlaneNormalEC;n" +         "uniform vec3 u_scanLineNormalEC;n" +         "uniform float u_radius;n" +         "uniform vec4 u_scanColor;n" +         "vec4 toEye(in vec2 uv, in float depth)n" +         " {n" +         " vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));n" +         " vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);n" +         " posInCamera =posInCamera / posInCamera.w;n" +         " return posInCamera;n" +         " }n" +         "bool isPointOnLineRight(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt)n" +         "{n" +         "vec3 v01 = testPt - ptOnLine;n" +         "normalize(v01);n" +         "vec3 temp = cross(v01, lineNormal);n" +         "float d = dot(temp, u_scanPlaneNormalEC);n" +         "return d > 0.5;n" +         "}n" +         "vec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point)n" +         "{n" +         "vec3 v01 = point -planeOrigin;n" +         "float d = dot(planeNormal, v01) ;n" +         "return (point - planeNormal * d);n" +         "}n" +         "float distancePointToLine(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt)n" +         "{n" +         "vec3 tempPt = pointProjectOnPlane(lineNormal, ptOnLine, testPt);n" +         "return length(tempPt - ptOnLine);n" +         "}n" +         "float getDepth(in vec4 depth)n" +         "{n" +         "float z_window = czm_unpackDepth(depth);n" +         "z_window = czm_reverseLogDepth(z_window);n" +         "float n_range = czm_depthRange.near;n" +         "float f_range = czm_depthRange.far;n" +         "return (2.0 * z_window - n_range - f_range) / (f_range - n_range);n" +         "}n" +         "void main()n" +         "{n" +

部分转自互联网,侵权删除联系

赞(0) 打赏
部分文章转自网络,侵权联系删除b2bchain区块链学习技术社区 » Cesium 雷达扫描方式、圆扩算求职学习资料
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

b2b链

联系我们联系我们