修复外轮廓显示错误的问题. 修改了相机的近距离和远距离

pull/7/head
ChenX 7 years ago
parent 6c79733557
commit 63e1f9d4a7

@ -38,9 +38,9 @@ export class CameraControl
constructor()
{
this.m_CameraArray.set(THREE.OrthographicCamera, new THREE.OrthographicCamera(-2, 2, 2, -2,
-10000, 10000));
-100, 100));
this.m_CameraArray.set(THREE.PerspectiveCamera, new THREE.PerspectiveCamera(50, 1, 0.1, 10000));
this.m_CameraArray.set(THREE.PerspectiveCamera, new THREE.PerspectiveCamera(50, 1, 0.1, 100));
this.m_CurCamera = this.m_CameraArray.get(THREE.OrthographicCamera);

@ -90,8 +90,10 @@ export class Viewer
this.m_RenderPass = new THREE.RenderPass(this.m_Scene, this.m_Camera.Camera);
this.m_Composer.addPass(this.m_RenderPass);
this.m_OutlinePass = new THREE.OutlinePass(new THREE.Vector2(this.Width, this.Height),
this.m_Scene, this.m_Camera.Camera);
let size = new THREE.Vector2(this.Width, this.Height);
this.m_OutlinePass = new THREE.OutlinePass(size, this.m_Scene, this.m_Camera.Camera);
this.m_OutlinePass.hiddenEdgeColor = this.m_OutlinePass.visibleEdgeColor;
this.m_Composer.addPass(this.m_OutlinePass);
this.m_effectFXAA = new THREE.ShaderPass(THREE.FXAAShader);
@ -105,6 +107,13 @@ export class Viewer
{
let CanvasWidth = width ? width : this.Width;
let CanvasHeight = height ? height : this.Height;
//校验.成为2的倍数 避免外轮廓错误.
if (CanvasWidth % 2 == 1)
CanvasWidth -= 1;
if (CanvasHeight % 2 == 1)
CanvasHeight -= 1;
this.m_Render.setSize(CanvasWidth, CanvasHeight);
this.m_Composer.setSize(CanvasWidth, CanvasHeight);
this.m_Camera.SetSize(CanvasWidth, CanvasHeight);

Loading…
Cancel
Save