diff --git a/src/GraphicsSystem/Viewer.ts b/src/GraphicsSystem/Viewer.ts index 43b780471..6347760ae 100644 --- a/src/GraphicsSystem/Viewer.ts +++ b/src/GraphicsSystem/Viewer.ts @@ -1,5 +1,5 @@ import * as THREE from 'three'; -import { Vector3 } from 'three'; +import { Vector3, OrthographicCamera } from 'three'; import * as xaop from 'xaop'; import { end } from 'xaop'; import { Database } from '../DatabaseServices/Database'; @@ -208,7 +208,8 @@ export class Viewer x: (ptVcs.x / this.Width) * 2 - 1, //-1 到 1 所以 (x-(w/2))/(w/2) => y: - (ptVcs.y / this.Height) * 2 + 1 //y轴相反 }, this.Camera); - raycaster.ray.origin.sub(raycaster.ray.direction.clone().multiplyScalar(1e9)); + if (this.Camera instanceof OrthographicCamera) + raycaster.ray.origin.sub(raycaster.ray.direction.clone().multiplyScalar(1e9)); return raycaster; }