|
@@ -93,20 +93,7 @@ export class ViewerBase extends THREE.EventDispatcher{
|
|
|
gl.bindVertexArray = extVAO.bindVertexArrayOES.bind(extVAO);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- /* let oldClear = gl.clear;
|
|
|
- gl.clear = (bits)=>{
|
|
|
- console.error('clear')
|
|
|
- }
|
|
|
- */
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
@@ -165,9 +152,11 @@ export class ViewerBase extends THREE.EventDispatcher{
|
|
|
if(height_ == 0)return //avoid NAN
|
|
|
|
|
|
let aspect = width_ / height_; //camera的参数精确些,不用视口的归整的resolution像素值,否则hasChange无法为true, 导致canvasResize了但map没update从而闪烁
|
|
|
- view.camera.aspect = aspect;
|
|
|
|
|
|
- if(view.camera.type == "OrthographicCamera"){
|
|
|
+ let camera = view.tranAimCamera || view.camera //当view.camera是viewer.scene.cameraBasic时使用tranAimCamera
|
|
|
+ camera.aspect = aspect;
|
|
|
+
|
|
|
+ if(camera.type == "OrthographicCamera"){
|
|
|
|
|
|
/* //不改宽度 同4dkk
|
|
|
var heightHalf = view.camera.right / aspect
|
|
@@ -175,10 +164,10 @@ export class ViewerBase extends THREE.EventDispatcher{
|
|
|
view.camera.bottom = -heightHalf */
|
|
|
//高宽都改 使大小不随视口大小改变 navvis (直接和视口大小一致即可,通过zoom来定大小)
|
|
|
|
|
|
- view.camera.left = -width_/2
|
|
|
- view.camera.right = width_/2
|
|
|
- view.camera.bottom = -height_/2;
|
|
|
- view.camera.top = height_/2
|
|
|
+ camera.left = -width_/2
|
|
|
+ camera.right = width_/2
|
|
|
+ camera.bottom = -height_/2;
|
|
|
+ camera.top = height_/2
|
|
|
|
|
|
|
|
|
}else{
|
|
@@ -186,7 +175,7 @@ export class ViewerBase extends THREE.EventDispatcher{
|
|
|
|
|
|
}
|
|
|
|
|
|
- view.camera.updateProjectionMatrix();
|
|
|
+ camera.updateProjectionMatrix();
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -247,21 +236,7 @@ export class ViewerBase extends THREE.EventDispatcher{
|
|
|
|
|
|
|
|
|
let {width, height} = size;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- /* let oldBudget = Potree.pointBudget;
|
|
|
- Potree.pointBudget = Math.max(10 * 1000 * 1000, 2 * oldBudget);
|
|
|
- let result = Potree.updatePointClouds(this.scene.pointclouds, camera, size );
|
|
|
- Potree.pointBudget = oldBudget;
|
|
|
|
|
|
-
|
|
|
- this.dispatchEvent({ //resize everything such as lines targets
|
|
|
- type: 'resize',
|
|
|
- resolution: new THREE.Vector2(width,height),
|
|
|
- });*/
|
|
|
-
|
|
|
let target = new THREE.WebGLRenderTarget(width, height, {
|
|
|
format: THREE.RGBAFormat,
|
|
|
});
|